Skip to content

chore: pre-push hook mirroring CI - #5

Merged
tarakanof merged 1 commit into
mainfrom
chore/pre-push-hook
Jun 10, 2026
Merged

tarakanof merged 1 commit into
mainfrom
chore/pre-push-hook

Conversation

@tarakanof

Copy link
Copy Markdown
Owner

Summary

  • .githooks/pre-push runs the same gates as CI (gofmt, go vet, go test ./... -race) locally before a push, so failures are caught before they hit GitHub Actions.
  • scripts/install-hooks.sh activates it via core.hooksPath — version-controlled, so it survives re-clones (unlike .git/hooks/). Run once per clone.
  • Scopes gofmt to tracked files (nested .claude/ worktrees aren't scanned), no-ops when go is absent, bypassable with git push --no-verify or EMBER_SKIP_HOOKS=1.

Pairs with the free GitHub-hosted CI (this repo is public → Actions is free): instant local feedback + server-side PR gate.

Test Plan

  • Hook passes on a clean tree
  • Hook blocks (exit 1) on a deliberately unformatted staged Go file
  • Reviewer: ./scripts/install-hooks.sh, then a push runs the checks

🤖 Generated with Claude Code

Catch a red build locally before it reaches GitHub. .githooks/pre-push runs the
same three gates as the CI workflow; scripts/install-hooks.sh activates it via
core.hooksPath (version-controlled, so it survives re-clones unlike .git/hooks).

The hook scopes gofmt to tracked files (so nested worktrees under .claude/ are
not scanned), no-ops when go is absent, and is bypassable with
`git push --no-verify` or EMBER_SKIP_HOOKS=1.
@tarakanof
tarakanof merged commit 9ebf18e into main Jun 10, 2026
1 check passed
@tarakanof
tarakanof deleted the chore/pre-push-hook branch June 10, 2026 10:15
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