Skip to content

fix(golangci-lint): better error message when config version doesn't match tool version#1081

Merged
malept merged 2 commits intomalept/feat/golangci-lint-2.9.0from
malept/dt-5156/fix/better-golangci-lint-version-mismatch-errors
Feb 17, 2026
Merged

fix(golangci-lint): better error message when config version doesn't match tool version#1081
malept merged 2 commits intomalept/feat/golangci-lint-2.9.0from
malept/dt-5156/fix/better-golangci-lint-version-mismatch-errors

Conversation

@malept
Copy link
Member

@malept malept commented Feb 17, 2026

What this PR does / why we need it

For whatever reason, golangci-lint v2 doesn't give a human-friendly error when it encounters a v1 config, despite the fact that it should know what to expect based on the version config value (or lack thereof).

Jira ID

DT-5156

Notes for reviewers

I tested this on a service that was having this issue (upgraded devbase RC but not stencil-golang RC) with the expected output:

❯ make lint
 :: Running linters
    -> shellcheck (.sh,.bash,.bats) (0.305s)
    -> shellfmt (.sh,.bash,.bats) (0.324s)
    -> go mod tidy (.go) (0.704s)
    -> golangci-lint (.go)
Error: /path/to/servicename/scripts/golangci.yml version (1) does not match golangci-lint major version (2). Restencil to get the latest configuration file from stencil-golang.
    -> golangci-lint (.go) (0.657s)
Error: linter failed to run. Please check the logs, 'make fmt' may help in some cases.
make: *** [.bootstrap/root/Makefile:124: lint] Error 1

@malept malept requested a review from a team as a code owner February 17, 2026 01:02
@atlassian

This comment was marked as outdated.

@getoutreach-ci-1
Copy link
Contributor

Link to code coverage report (posted by coverbot 🤖)

@malept malept merged commit 07b370a into malept/feat/golangci-lint-2.9.0 Feb 17, 2026
12 checks passed
@malept malept deleted the malept/dt-5156/fix/better-golangci-lint-version-mismatch-errors branch February 17, 2026 05:17
malept added a commit that referenced this pull request Feb 17, 2026
* fix(golangci-lint): Go >= 1.26 needs golangci-lint >= 2.9.0
* fix(golangci-lint): only append arguments if they work for the given subcommand
* fix(golangci-lint): better error message when config version doesn't match tool version (#1081)
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