Skip to content

golangci-lint JSON trailer is parsed as a clean run #15

Closed

Description

@DatScreamer

Summary

parseGolangciLintJson in src/harness/check-engine/output-parsers-extra.ts passes golangci-lint stdout straight to JSON.parse. golangci-lint v2, invoked with --output.json.path stdout, writes the JSON report and then a text trailer on the same stream, for example:

{ "Issues": [ ... ] }
1 issues:
* errcheck: 1

JSON.parse rejects that trailer (Unexpected non-whitespace character after JSON). The parser's catch returns []. interlinked check --only golangci-lint then reports count: 0 and exits 0, which is a false clean when the report contains issues.

This is separate from the removed --out-format flag (#11) and from non-success exit codes (#13). Those can be correct and this parse still drops the issues, because exit 1 (IssuesFound) is the path that parses stdout.

Expected

Read the first JSON object and ignore the text trailer. An issue list in that object is returned as findings. Output that is not JSON still returns no findings.

Activity

  1. QuentinCody commented on Oct 9, 2026

    @QuentinCody
    Owner

    Fixed by a2adc8a (merged in #14).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions