Skip to content

Commit

Permalink
auto code format on push
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdcvlsc committed Jun 30, 2023
1 parent 342d362 commit 7747ffd
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -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 "Last commit '${{ github.event.head_commit.message }}' was formatted"

- name: Push Changes
run: git push --force
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 20 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down

0 comments on commit 7747ffd

Please sign in to comment.