Skip to content

Commit

Permalink
Formatting PR
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Baker <[email protected]>
  • Loading branch information
PeterBaker0 committed Oct 25, 2024
1 parent 923afe4 commit dbeccf4
Show file tree
Hide file tree
Showing 80 changed files with 16,889 additions and 16,465 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Code Formatting Check

on:
pull_request:
branches: [main, develop]

jobs:
format-check:
name: Prettier Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-
- name: Install Dependencies
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

- name: Check formatting
run: npm run format:check

- name: Comment on PR if formatting issues found
if: failure()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.name,
body: '❌ Code formatting check failed. Please run `npm run format:write` locally and commit the changes.'
})
6 changes: 3 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": false,
"bracketSpacing": true,
"arrowParens": "avoid",
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"bracketSameLine": false,
"proseWrap": "preserve"
}
}
Loading

0 comments on commit dbeccf4

Please sign in to comment.