tooling: add pre-push hook matching the CI gate#130
Merged
Conversation
Adds a one-time setup command that installs a .git/hooks/pre-push hook running the same two checks as the CI matrix (ubuntu/macos/windows): bun run typecheck -- tsc --noEmit, catches type errors before push bun run test -- full unit suite under tests/ Usage (run once after cloning): bun run setup:hooks Skip in an emergency: git push --no-verify Files: - scripts/pre-push.sh POSIX sh hook shim (works on all platforms) - scripts/setup-hooks.ts cross-platform installer (bun script) - package.json adds prepush and setup:hooks script entries - CONTRIBUTING.md documents the one-liner for new contributors
Wibias
marked this pull request as ready for review
July 14, 2026 19:17
Owner
|
Merged into dev and released in v2.7.19 — thanks! Stacked a few hardening commits on top (cac1192): hooks dir now resolved via |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a one-time setup command (
bun run setup:hooks) that installs a.git/hooks/pre-pushhook running the same two checks as the CI matrix:bun run typecheck-- tsc --noEmitbun run test-- full unit suiteAlso fixes a test failing on Windows CI runners: the symlink-ownership test in
tests/claude-agents-inject.test.tsnow catchesEPERMand skips gracefully when the runner lacks Developer Mode / SeCreateSymbolicLinkPrivilege. The underlying implementation is correct -- the guard was only needed in the test setup.Files
scripts/pre-push.sh-- POSIX sh hook shim, works on Windows/macOS/Linuxscripts/setup-hooks.ts-- cross-platform installerpackage.json-- addsprepushandsetup:hooksscript entriesCONTRIBUTING.md-- documents the one-liner for new contributorstests/claude-agents-inject.test.ts-- EPERM-safe symlink testWhy
Catches type errors and test failures locally before they hit the remote CI runners. The
ctx?.signalvsctx?.abortSignalmistake on the MiMo Free PR would have been caught at push time instead of in the Actions log.Skip in an emergency:
git push --no-verify