Skip to content

Pin golangci-lint version for local and CI runs - #1069

Merged
rck merged 1 commit into
v2from
pin-golangci-lint
Sep 30, 2026
Merged

rck merged 1 commit into
v2from
pin-golangci-lint

Conversation

@WanzenBug

Copy link
Copy Markdown
Member

CI used whatever golangci-lint release was latest, while the pre-commit hook used the binary from the developer's PATH, so results could drift.

Pin the version in .golangci-lint-version, which the GitHub action reads via version-file. Locally, "make lint" installs that exact release to bin/ and the pre-commit hook now runs it.

Pin v2.12.2, the newest release built with Go 1.26. Later releases are built with Go 1.27, and their bundled gofumpt formats code differently than go fmt from the Go version in go.mod.

@WanzenBug
WanzenBug requested a review from rck September 29, 2026 07:09

@rck rck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two suggestions on the Makefile, both verified locally: guard against an empty version (which the installer reads as "latest"), and fetch the install script at the pinned tag instead of HEAD.

Comment thread Makefile Outdated
Comment thread Makefile Outdated
CI used whatever golangci-lint release was latest, while the pre-commit
hook used the binary from the developer's PATH, so results could drift.

Pin the version in .golangci-lint-version, which the GitHub action reads
via version-file. Locally, "make lint" installs that exact release to
bin/ and the pre-commit hook now runs it.

Pin v2.12.2, the newest release built with Go 1.26. Later releases are
built with Go 1.27, and their bundled gofumpt formats code differently
than go fmt from the Go version in go.mod.

Signed-off-by: Moritz Tanner <moritz.tanner@linbit.com>

@rck rck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@rck
rck merged commit cbce776 into v2 Sep 30, 2026
7 checks passed
@rck
rck deleted the pin-golangci-lint branch September 30, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants