Skip to content

chore: add pre-push lint gate via lefthook#1466

Merged
fi3ework merged 1 commit into
mainfrom
chore-pre-push-lint-gate
Jun 23, 2026
Merged

chore: add pre-push lint gate via lefthook#1466
fi3ework merged 1 commit into
mainfrom
chore-pre-push-lint-gate

Conversation

@fi3ework

@fi3ework fi3ework commented Jun 23, 2026

Copy link
Copy Markdown
Member

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 the pre-commit hook was skipped. This adds a lefthook pre-push stage that mirrors those checks before pushing:

  • format-spell — whole-repo prettier --check + spell check; runs on every push (build-free).
  • typecheckpnpm build && rslint --type-check. rslint --type-check reads 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-version moves off pre-commit onto pre-push, gated by glob so it runs only when package.json changes.

format-spell and typecheck run in parallel. The build's only prettier-checked output — the generated packages/*/LICENSE.md bundles — is added to .prettierignore so the whole-repo prettier --check cannot race the build writing them.

The pre-commit pnpm dedupe --check is 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-commit now runs prettier --write --ignore-unknown on staged files (no extension glob), so it formats the same files prettier --check . validates — yaml included. Hooks install through the existing prepare script (lefthook install).

Checklist

  • Tests updated (or not required). — tooling/config change, no code under test.
  • Documentation updated (or not required).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread lefthook.yml Outdated
@fi3ework fi3ework force-pushed the chore-pre-push-lint-gate branch from e316668 to b614f8f Compare June 23, 2026 12:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread lefthook.yml Outdated
@fi3ework fi3ework force-pushed the chore-pre-push-lint-gate branch from b614f8f to 2556ecb Compare June 23, 2026 12:30
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.
@fi3ework fi3ework force-pushed the chore-pre-push-lint-gate branch from 2556ecb to f398946 Compare June 23, 2026 12:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread lefthook.yml
@fi3ework fi3ework enabled auto-merge (squash) June 23, 2026 12:59
@fi3ework fi3ework merged commit 7b60b0a into main Jun 23, 2026
12 checks passed
@fi3ework fi3ework deleted the chore-pre-push-lint-gate branch June 23, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant