Repository navigation
fix: report golangci-lint analysis failures instead of a clean run - #14
Merged
QuentinCody merged 3 commits intoOct 9, 2026
Merged
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.
Exit codes 3 through 7 mean the analysis did not finish. Return a no-verdict warning for those codes and for a timed-out process. Exit 0 stays clean, and issue output is still parsed.
DatScreamer
force-pushed
the
fix/golangci-lint-no-verdict
branch
from
October 9, 2026 09:41
9130ca6 to
dc72336
Compare
Contributor
Author
|
Rebased onto current |
golangci-lint v2 can write the JSON report and then a text summary on the same stdout. JSON.parse rejected that trailer and the parser returned no findings. Read the first JSON object and ignore the trailer.
QuentinCody
approved these changes
Oct 9, 2026
This was referenced Oct 9, 2026
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 #13
Summary
Exit codes 3 through 7 mean golangci-lint did not finish an analysis (
Failure,Timeout,NoGoFiles,NoConfigFileDetected,ErrorWasLogged).runGolangciLintandrunGolangciLintAsyncused to return no findings for 3 and 4, which is the same result as a clean exit 0. They now return a warning that golangci-lint did not produce a verdict. A process that times out or is killed does the same.Exit 0 stays an empty finding list. Exit 1 still parses the JSON issues.
Stacked on #12. This branch also contains the v2 JSON-flag commit from that pull request.
Tests
go.integration.test.tscovers exits 3 through 7 and a spawn timeout. The missing-module case must not come back as a parsed issue list.