Skip to content

fix(repo): run shared hooks only at pre-commit - #696

Open
FradSer wants to merge 1 commit into
langgenius:mainfrom
FradSer:fix/repo-hook-stages
Open

FradSer wants to merge 1 commit into
langgenius:mainfrom
FradSer:fix/repo-hook-stages

Conversation

@FradSer

@FradSer FradSer commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Limit hooks without an explicit stage to pre-commit. Keep the commit-message validator explicitly on commit-msg.

Why

With both hook types installed, unstaged shared hooks also run at commit-message time. A commit-message validation should not rerun formatting, lint, or staged-file checks. This supplies the missing default stage without changing the explicit validator stage.

Extracted from the unrelated tooling changes removed from #693 at review request 6. Existing issues and PRs were searched; no dedicated open issue was found. No issue is closed by this PR.

Verification

  • just fmt-check; just commit-check.
  • prek -c config/prek.toml run --stage commit-msg --commit-msg-filename .tmp/COMMIT_EDITMSG: only the commit-message validator runs and passes.
  • prek -c config/prek.toml run --stage pre-commit --files config/prek.toml: applicable hooks pass.
  • Before/after dry-run comparison confirms shared hooks no longer participate at commit-msg.
  • Exact-head just check was attempted on local Linux (Bun 1.4.0): format/docs/lint/type stages passed; the unchanged Driver backpressure fixture failed (openai-app-server-client.test.ts:2055; 2,281 passed / 47 skipped / 1 failed). This initial full-gate failure is retained, not claimed as a pass.
  • Fresh hook-stage acceptance passed again. All three shared Driver failure cases pass in isolation; the identical Driver pin also passed the complete #699 hosted gate. No Driver change is included.
  • Full hosted CI is triggered by Ready for review; see Checks for this PR’s own current result.

Review

  • Closest review area: config/prek.toml.
  • Env/config changes: one default hook stage; existing hook installation types remain intact.
  • Known trade-offs: contributors must reinstall hooks as documented after hook configuration changes.

Impact

  • Generated files / GraphQL / DB / lockfile: N/A; unchanged.
  • Risk and rollback: revert this isolated commit. No deployment or migration.

Design

N/A: no product UI changes.

@FradSer
FradSer marked this pull request as ready for review October 16, 2026 07:45

This branch has not been deployed

No deployments
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