Skip to content

Fix make tools installing golangci-lint v1 against a v2 config - #150

Open
martinlaws wants to merge 1 commit into
basecamp:mainfrom
martinlaws:fix/golangci-v2-tools
Open

Fix make tools installing golangci-lint v1 against a v2 config#150
martinlaws wants to merge 1 commit into
basecamp:mainfrom
martinlaws:fix/golangci-v2-tools

Conversation

@martinlaws

@martinlaws martinlaws commented Jul 30, 2026

Copy link
Copy Markdown

make tools installs golangci-lint from the v1 module path, but .golangci.yml is version: "2". So a clean setup following CONTRIBUTING.md breaks at the first lint:

$ make tools
$ make lint
golangci-lint run ./...
Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2
make: *** [lint] Error 3

That also takes out make check, which CONTRIBUTING.md asks contributors to run before opening a PR.

The fix is the /v2/ module path — v1 and v2 are separate modules, so @latest on the old path keeps resolving to the last v1 release:

-	go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
+	go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest

CI never hits this because it doesn't use make toolsci.yml and test.yml both install through golangci-lint-action pinned to v2.10.1, and .mise.toml pins 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 lint fails as above; after it, make check passes clean.

One thing you may want on top, which I've deliberately left alone: CI pins v2.10.1 while this line is @latest, currently resolving to 2.12.2. Local lint can therefore be stricter than CI. Happy to pin the Makefile to match instead — I kept @latest to stay consistent with the other installs in the target.


Summary by cubic

Update make tools to install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest, aligning with .golangci.yml v2. This fixes clean setups where make lint failed with a v1 binary and restores make check.

Written for commit 317c4c6. Summary will update on new commits.

Review in cubic

`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.
Copilot AI review requested due to automatic review settings July 30, 2026 07:18
@github-actions github-actions Bot added the bug Something isn't working label Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tools to install golangci-lint from the /v2/ Go module path so it matches the v2 config.
  • Restore clean local setup behavior where make lint previously 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants