Repository navigation
fix: select golangci-lint JSON output flag by major version - #12
Closed
DatScreamer wants to merge 1 commit into
Closed
DatScreamer wants to merge 1 commit into
DatScreamer wants to merge 1 commit into
Conversation
golangci-lint v2 removed --out-format. Probe `golangci-lint version` and pass --output.json.path=stdout on v2+, keeping --out-format=json for v1 and for unrecognized version text.
DatScreamer
force-pushed
the
fix/golangci-lint-v2-json-output
branch
from
October 9, 2026 09:41
013e5ba to
af9672c
Compare
Contributor
Author
|
Rebased onto current |
Owner
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.
Fixes #11
Summary
runGolangciLintalways passed--out-format=json. golangci-lint v2 removed that flag, so the run exits before analysis. This probesgolangci-lint versionand selects the flag from the major version:--out-format=json--output.json.path=stdoutA full
commandoverride in tool commands is still passed through unchanged.Tests
go.integration.test.tscovers the v1 and v2 argv, andgolangciJsonFormatArgcovers 1.x, 2.x, and empty version text.