Open
Conversation
Contributor
|
setup and hook need to use task cmds. global golangci-lint is a bad idea, because linting rules and behavior changes a lot between versions. taskfile pins versions and that matches the committed code. |
8b3690a to
b514dae
Compare
Contributor
|
@alenkacz i updated this PR to have the taskw, what do you think? the setup is now clean and uses the existing tooling |
birdayz
approved these changes
Jan 16, 2026
1ac1cc1 to
7506186
Compare
Add a pre-commit hook that runs golangci-lint on staged Go files. Uses taskw wrapper to auto-download pinned versions of go-task and golangci-lint, eliminating external dependencies. Files added: - .githooks/pre-commit: runs linter on staged Go files - .githooks/setup.sh: configures git to use .githooks directory - taskw: wrapper that downloads pinned go-task version - .taskversion: pins go-task to v3.40.0 Run '.githooks/setup.sh' after cloning to enable the hook.
7506186 to
4d5a66f
Compare
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
golangci-linton staged Go files before each commitSetup
./.githooks/setup.sh # One-time after cloningTest plan
Manually tested the hook:
No Go files staged - Hook passes immediately:
Go file with valid changes - Hook runs linter and passes:
Missing golangci-lint - Hook provides installation instructions
Linting issues found - Hook blocks commit with helpful message:
🤖 Generated with Claude Code