Skip to content

fix: report golangci-lint analysis failures instead of a clean run - #14

Merged
QuentinCody merged 3 commits into
QuentinCody:mainfrom
DatScreamer:fix/golangci-lint-no-verdict
Oct 9, 2026
Merged

QuentinCody merged 3 commits into
QuentinCody:mainfrom
DatScreamer:fix/golangci-lint-no-verdict

Conversation

@DatScreamer

Copy link
Copy Markdown
Contributor

Fixes #13

Summary

Exit codes 3 through 7 mean golangci-lint did not finish an analysis (Failure, Timeout, NoGoFiles, NoConfigFileDetected, ErrorWasLogged). runGolangciLint and runGolangciLintAsync used 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.ts covers exits 3 through 7 and a spawn timeout. The missing-module case must not come back as a parsed issue list.

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
DatScreamer force-pushed the fix/golangci-lint-no-verdict branch from 9130ca6 to dc72336 Compare October 9, 2026 09:41
@DatScreamer

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (31b5259f) on top of the flag-selection commit in #12. The previous head carried the same outdated fork history. This head is two commits: af9672c8 and dc723364.

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.
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.

golangci-lint non-success exits are reported as a clean run

2 participants