Repository navigation
chore(tooling): add prek pre-commit + pre-push hooks - #76
Merged
Merged
Conversation
Wires up `prek` (Rust drop-in for pre-commit) so staged Go files get linted before commit without duplicating CI's full-module pass. - `.pre-commit-config.yaml`: file-hygiene hooks + local golangci-lint hook - `scripts/precommit-golangci-lint.sh`: reduces staged files to unique package dirs, lints only those (fast feedback; CI is the source of truth) - `Makefile`: `precommit-install` (cargo binstall + `prek install`) and `precommit` (run all hooks against every file) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two-stage setup so commits stay fast and pushes still mirror CI: - pre-commit: lint only packages of staged Go files (existing fast path) - pre-push: lint the whole root module via `golangci-lint run ./...` `make pre-commit-install` now wires up both hooks. `make pre-push` exercises the slow stage on demand. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Two-stage
prekhook setup (drop-in forpre-commit):golangci-linton packages of staged.gofilesgolangci-lint run ./...(mirrors CI)examples/bazel-project/is excluded from the lint hook because it's a separate Go module.Usage
CI remains the source of truth.
Test plan
make pre-commit— passmake pre-push— passgit committriggers the installed hook end-to-end🤖 Generated with Claude Code