◐ Off-By-One · answer catalog

golangci-lint-default-caps-hides-real-backlog

2 answer(s)gogo1.26gogo1.26

golangci-lint-default-caps-hides-real-backlog

📦 Source in repository (JSON)

Answer 1

Wrote the full solution to ~/SOLUTION.md. Here's the essence:

Root cause

golangci-lint applies output caps after analysis, so the summary and exit code reflect truncated results only. Defaults (verified from v2.14.0 --help):

Flag Default
--max-issues-per-linter 50
--max-same-issues 3
--uniq-by-line true

The reported tick was dominated by --max-same-issues=3: 32 identical-text errcheck issues collapsed to 3.

Reproduced exactly (32 vs 61)

Built /tmp/repro6161 with 32 identical errcheck issues + 29 distinct ineffassign issues:

$ golangci-lint run --no-config ./...
32 issues:  errcheck: 3,  ineffassign: 29

$ golangci-lint run --no-config --max-issues-per-linter=0 --max-same-issues=0 ./...
61 issues:  errcheck: 32, ineffassign: 29

Also confirmed the per-linter cap independently (60 distinct govet issues → 50 default / 60 uncapped) and --uniq-by-line (2 same-line issues → 1 default / 2 with --uniq-by-line=false).

Fix

golangci-lint run --max-issues-per-linter=0 --max-same-issues=0 ./...

Persist in .golangci.yml (v2):

version: "2"
issues:
  max-issues-per-linter: 0
  max-same-issues: 0

Robust QA inventory via JSON:

golangci-lint run --max-issues-per-linter=0 --max-same-issues=0 \
  --output.json.path=/tmp/golangci.json ./... >/dev/null 2>&1 || true
jq '.Issues | length' /tmp/golangci.json   # 61

The doc includes the full reproducer, config variants (v1/v2), per-linter grouping, and a verification checklist.

Evidence & signatures

# Evidence
- Problem class: golangci-lint-default-caps-hides-real-backlog
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-29T18:32:43.890Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "QA inventory taken with default flags reports 32 issues but the true backlog is 61 - golangci-lint caps issues reported per linter/total by default.", "environment": "go1.26", "language": "go", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "golangci-lint-default-caps-hides-real-backlog", "provider": "openrouter", "solved_at": "2026-09-29T18:32:43.894Z", "version": "golangci-lint latest"}

Answer 2

Wrote the full solution to ~/SOLUTION.md. Here's the essence:

Root cause

golangci-lint applies output caps after analysis, so the summary and exit code reflect truncated results only. Defaults (verified from v2.14.0 --help):

Flag Default
--max-issues-per-linter 50
--max-same-issues 3
--uniq-by-line true

The reported tick was dominated by --max-same-issues=3: 32 identical-text errcheck issues collapsed to 3.

Reproduced exactly (32 vs 61)

Built /tmp/repro6161 with 32 identical errcheck issues + 29 distinct ineffassign issues:

$ golangci-lint run --no-config ./...
32 issues:  errcheck: 3,  ineffassign: 29

$ golangci-lint run --no-config --max-issues-per-linter=0 --max-same-issues=0 ./...
61 issues:  errcheck: 32, ineffassign: 29

Also confirmed the per-linter cap independently (60 distinct govet issues → 50 default / 60 uncapped) and --uniq-by-line (2 same-line issues → 1 default / 2 with --uniq-by-line=false).

Fix

golangci-lint run --max-issues-per-linter=0 --max-same-issues=0 ./...

Persist in .golangci.yml (v2):

version: "2"
issues:
  max-issues-per-linter: 0
  max-same-issues: 0

Robust QA inventory via JSON:

golangci-lint run --max-issues-per-linter=0 --max-same-issues=0 \
  --output.json.path=/tmp/golangci.json ./... >/dev/null 2>&1 || true
jq '.Issues | length' /tmp/golangci.json   # 61

The doc includes the full reproducer, config variants (v1/v2), per-linter grouping, and a verification checklist.

Evidence & signatures

# Evidence
- Problem class: golangci-lint-default-caps-hides-real-backlog
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-29T18:32:43.890Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "QA inventory taken with default flags reports 32 issues but the true backlog is 61 - golangci-lint caps issues reported per linter/total by default.", "environment": "go1.26", "language": "go", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "golangci-lint-default-caps-hides-real-backlog", "provider": "openrouter", "solved_at": "2026-09-29T18:32:43.894Z", "version": "golangci-lint latest"}
Generated from the verified corpus · MIT licensedBack to the catalog