Skip to content

Commit a86c3c1

Browse files
committed
ci: run fallow audit in lefthook pre-commit
Mirrors the same `fallow audit --base ... --fail-on-issues` check that runs in CI, but locally against HEAD so issues surface at commit time instead of after the push round-trip. Scoped to `packages/**` source files via the glob — non-code edits (README, docs, top-level configs) skip the hook entirely. Measured locally: ~5s in parallel with the existing lint/format/typecheck checks. Doesn't extend wall-clock time because typecheck (~11s) is the long pole, and lefthook runs commands in parallel. The default `--gate new-only` means inherited findings don't block the commit — same gate behavior as CI, so local pre-commit and PR audit agree.
1 parent 17f47f3 commit a86c3c1

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

bun.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lefthook.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ pre-commit:
1212
typecheck:
1313
glob: "*.{ts,tsx}"
1414
run: cd packages/core && bunx tsc --noEmit && cd ../studio && bunx tsc --noEmit
15+
# Mirrors the CI gate (same `--base origin/main` so the local hook can't
16+
# pass on a branch CI would fail). Audits the working tree, which means
17+
# unstaged WIP in `packages/**` is part of the diff — stash before
18+
# committing if that surprises you. `--gate new-only` (the default) only
19+
# fails on issues introduced by the branch, not inherited findings.
20+
fallow:
21+
glob: "packages/**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}"
22+
run: bunx fallow audit --base origin/main --fail-on-issues
1523
filesize:
1624
# Scoped to packages/studio — the 500 LOC limit is a studio architecture
1725
# standard enforced as part of the App.tsx decomposition work. Player and

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@hyperframes/player": "workspace:*",
4141
"@types/node": "^25.0.10",
4242
"concurrently": "^8.2.0",
43+
"fallow": "^2.75.0",
4344
"happy-dom": "^20.9.0",
4445
"knip": "^6.0.3",
4546
"lefthook": "^2.1.4",

0 commit comments

Comments
 (0)