Fix make tools installing golangci-lint v1 against a v2 config - #150
Open
martinlaws wants to merge 1 commit into
Open
Fix make tools installing golangci-lint v1 against a v2 config#150martinlaws wants to merge 1 commit into
make tools installing golangci-lint v1 against a v2 config#150martinlaws wants to merge 1 commit into
Conversation
`make tools` installed from the v1 module path while .golangci.yml is
version: "2", so `make lint` fails immediately after a clean setup:
Error: you are using a configuration file for golangci-lint v2
with golangci-lint v1: please use golangci-lint v2
make: *** [lint] Error 3
CI does not catch this because it never runs `make tools` — ci.yml and
test.yml both use golangci-lint-action pinned to v2.10.1. The break
only surfaces for someone setting up locally from CONTRIBUTING.md.
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns the local developer tooling install path for golangci-lint with the repository’s .golangci.yml config format (v2), so fresh environments can successfully run make lint / make check after following CONTRIBUTING.md.
Changes:
- Update
make toolsto installgolangci-lintfrom the/v2/Go module path so it matches the v2 config. - Restore clean local setup behavior where
make lintpreviously failed due to installing a v1 binary.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
make toolsinstalls golangci-lint from the v1 module path, but.golangci.ymlisversion: "2". So a clean setup followingCONTRIBUTING.mdbreaks at the first lint:That also takes out
make check, whichCONTRIBUTING.mdasks contributors to run before opening a PR.The fix is the
/v2/module path — v1 and v2 are separate modules, so@lateston the old path keeps resolving to the last v1 release:CI never hits this because it doesn't use
make tools—ci.ymlandtest.ymlboth install throughgolangci-lint-actionpinned tov2.10.1, and.mise.tomlpins only Go. So the break is invisible to the project and only lands on someone setting up locally for the first time.Verified on macOS: before the change
make lintfails as above; after it,make checkpasses clean.One thing you may want on top, which I've deliberately left alone: CI pins
v2.10.1while this line is@latest, currently resolving to2.12.2. Local lint can therefore be stricter than CI. Happy to pin the Makefile to match instead — I kept@latestto stay consistent with the other installs in the target.Summary by cubic
Update
make toolsto installgithub.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest, aligning with.golangci.ymlv2. This fixes clean setups wheremake lintfailed with a v1 binary and restoresmake check.Written for commit 317c4c6. Summary will update on new commits.