Repository navigation
fix: don't block commits when a project uses custom golangci-lint linters - #23
Merged
Merged
Conversation
…ters The pre-commit hook ran the golangci-lint on PATH, which doesn't know linters that projects add via the module plugin system. On those repos it exited with "unknown linters" and blocked every commit. resolve_golangci() now prefers a project's custom build: honor GOPILOT_GOLANGCI_LINT if set, else detect .custom-gcl.yml and run the binary named by its name/destination fields, else fall back to PATH. When the config exists but the binary isn't built, skip lint with a note rather than running the wrong binary (building inside the hook timeout is fragile). Document the module plugin system in the linting reference and SKILL.md.
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.
The gopilot pre-commit hook ran the golangci-lint on PATH, which only knows the linters compiled into it. Projects that add custom/private linters via golangci-lint's module plugin system build a dedicated binary (
golangci-lint custom→./custom-gcl); against those repos the PATH binary exits with "unknown linters" and blocked every single commit.resolve_golangci()now picks the right binary:GOPILOT_GOLANGCI_LINTif set, else detect.custom-gcl.ymland run the binary named by itsname/destinationfields, else fall back to PATH. When the config exists but the binary isn't built yet, lint is skipped with a note instead of running the wrong binary — building inside the 120s PreToolUse hook would be slow and fragile. The module plugin system is now documented in the linting reference, with a pointer from SKILL.md.