Skip to content

Commit 70ec6bb

Browse files
committed
ci: enforce the format check locally and in the pipeline
- Extend the pre-commit hook to run lint and the format check joined by a shell AND, so the first failure short circuits and the hook exits with the failing command's status. The hook reports and rejects; it never rewrites a file, leaving the format and lint:fix scripts as the explicit manual escapes. - The hook runs the same two scripts the pipeline runs, over the whole repository rather than over staged paths only, so green locally and red on push cannot disagree. No new dependency was needed to do it. - Insert a Format check step into the workflow between typecheck and test, invoking the script by name. Nothing else about the workflow changes.
1 parent 3ba808d commit 70ec6bb

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
- name: Typecheck
4545
run: npm run typecheck
4646

47+
- name: Format check
48+
run: npm run format:check
49+
4750
- name: Test
4851
run: npm test
4952

‎.husky/pre-commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm run lint
1+
npm run lint && npm run format:check

0 commit comments

Comments
 (0)