chore: add pre-push lint gate via lefthook#1466
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e31666880d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e316668 to
b614f8f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b614f8f388
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b614f8f to
2556ecb
Compare
Run the CI lint checks (prettier --check, cspell, rslint --type-check) on pre-push so failures surface locally instead of in CI. format-spell (prettier --check + spell) runs on every push; typecheck (pnpm build && rslint --type-check) runs unless the push is entirely markdown, so a docs-only push skips the build while config inputs (tsconfig.json, rslint.config.mts) still gate it. The two run in parallel; the build's only prettier-checked output, packages/*/LICENSE.md, is added to .prettierignore so it cannot race the format-spell scan. Move check-dependency-version off pre-commit onto pre-push, gated by glob so it runs only when package.json changes. Drop the pre-commit `pnpm dedupe --check`: it perturbs pnpm's modules state, CI already runs it (ordered last to stay safe), and pre-push's parallel commands give no ordering control to isolate it from the build. pre-commit now runs prettier --write --ignore-unknown on staged files (no extension glob) so it covers the same files as prettier --check ., yaml included.
2556ecb to
f398946
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f398946bac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
The CI "Lint" gate (
prettier --check, cspell,rslint --type-check) only runs after push, so lint failures surface in CI instead of locally — especially for commits made in worktrees where thepre-commithook was skipped. This adds a lefthookpre-pushstage that mirrors those checks before pushing:format-spell— whole-repoprettier --check+ spell check; runs on every push (build-free).typecheck—pnpm build && rslint --type-check.rslint --type-checkreads built.d.ts, so it builds first. Runs unless the push is entirely markdown, so a docs-only push skips the build while config inputs (tsconfig.json,rslint.config.mts, …) still gate it.check-dependency-versionmoves offpre-commitontopre-push, gated by glob so it runs only whenpackage.jsonchanges.format-spellandtypecheckrun in parallel. The build's only prettier-checked output — the generatedpackages/*/LICENSE.mdbundles — is added to.prettierignoreso the whole-repoprettier --checkcannot race the build writing them.The pre-commit
pnpm dedupe --checkis dropped rather than moved: it perturbs pnpm's modules state, CI already runs it (ordered last to stay safe), and pre-push's parallel commands give no ordering control to isolate it from the build.pre-commitnow runsprettier --write --ignore-unknownon staged files (no extension glob), so it formats the same filesprettier --check .validates — yaml included. Hooks install through the existingpreparescript (lefthook install).Checklist