diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..4c5a379 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,39 @@ +name: format + +on: + push: + branches: [ "master", "main" ] + +jobs: + format-code-on-push: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Configure Email + run: git config --local user.email ${{ github.event.pusher.email }} + + - name: Configure Name + run: git config --local user.name ${{ github.event.pusher.name }} + + - name: Git Status + run: git status + + - name: Format Code Style + run: npm run format + + - name: Stage Changes + run: git add . + + - name: Save Changes + run: git commit -m "Auto-format code on push [no ci]" -m "Formatted the last commit -> '${{ github.event.head_commit.message }}'" + + - name: Push Changes + run: git push --force \ No newline at end of file diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 8ea6556..66ee6bf 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -37,8 +37,8 @@ jobs: # VALIDATE_PYTHON_BLACK: true VALIDATE_JAVASCRIPT_ES: true - VALIDATE_HTML: true - VALIDATE_CSS: true + # VALIDATE_HTML: true + # VALIDATE_CSS: true # where your linter config files should go like; # .prettierrc.json, .clang-fromat, .eslintrc.yml, .htmlhintrc, etc. diff --git a/app.js b/app.js index 7cf7290..4a97fcb 100644 --- a/app.js +++ b/app.js @@ -1,12 +1,28 @@ import path from 'path'; -import { fileURLToPath } from 'url'; +import { + + + + + + fileURLToPath } from 'url'; import { showLocalNetworkIP } from './shownet.js'; -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); +const __filename = +fileURLToPath( + import.meta.url + + + + ); + + +const __dirname = path. +dirname(__filename); const PORT = process.env.PORT || 8080; -showLocalNetworkIP(PORT); +showLocalNetworkIP( + PORT); import fastify from 'fastify'; diff --git a/readme.md b/readme.md index a8ae03b..d826864 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,7 @@ # **MiniMax Tic-Tac-Toe** ![tests](https://github.com/mrdcvlsc/minimax-tic-tac-toe/actions/workflows/tests.yml/badge.svg) +![linter](https://github.com/mrdcvlsc/minimax-tic-tac-toe/actions/workflows/linter.yml/badge.svg) A simple project showcasing my **naive implementation** of [**minimax**](https://en.wikipedia.org/wiki/Minimax#Pseudocode) algorithm for a **tic-tac-toe** web application game.