Skip to content

chore(lint): add static analysis tools: govulncheck, testifylint, rowserrcheck, noctx, wastedassign, intrange, wrapcheck, musttag#599

Merged
cpcloud merged 1 commit intomainfrom
worktree-async-wobbling-valley
Mar 4, 2026
Merged

chore(lint): add static analysis tools: govulncheck, testifylint, rowserrcheck, noctx, wastedassign, intrange, wrapcheck, musttag#599
cpcloud merged 1 commit intomainfrom
worktree-async-wobbling-valley

Conversation

@cpcloud
Copy link
Copy Markdown
Collaborator

@cpcloud cpcloud commented Mar 4, 2026

Summary

  • Enable 7 new golangci-lint linters: testifylint, rowserrcheck, noctx, wastedassign, intrange, wrapcheck, musttag
  • Add govulncheck as pre-commit hook and CI job with .govulncheck-exclude for filtering vuln IDs with no upstream fix
  • Add gosec G204/G704 exclusion for test files (controlled test binary paths, not user input)
  • Fix all existing violations across ~55 files

closes #596

…serrcheck, noctx, wastedassign, intrange, wrapcheck, musttag

Enable 7 new golangci-lint linters and add govulncheck as a pre-commit
hook and CI job with exclude-list filtering.

golangci-lint linters:
- testifylint: enforce require for error assertions, prefer assert.Empty/Len/Positive
- rowserrcheck: check sql.Rows.Err() is checked
- noctx: enforce context-aware HTTP and exec calls
- wastedassign: detect dead assignments
- intrange: use range-over-int syntax
- wrapcheck: enforce error wrapping at package boundaries
- musttag: enforce struct tags where needed

govulncheck:
- Wrapper filters JSON output against .govulncheck-exclude for vuln IDs
  with no upstream fix (all 9 currently in ollama/ollama)
- Runs as pre-commit hook (on go.mod/go.sum changes) and CI job
- Uses symbol-level analysis to only flag vulns with actual call traces

Also adds gosec G204/G704 exclusion for test files and fixes all existing
violations across ~55 files.

closes #596

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 58.10811% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.09%. Comparing base (5cb5c58) to head (45aa916).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/app/docopen.go 0.00% 9 Missing ⚠️
internal/data/path.go 0.00% 6 Missing ⚠️
cmd/micasa/main.go 0.00% 4 Missing ⚠️
internal/app/model.go 0.00% 4 Missing ⚠️
internal/data/sqlite/migrator.go 0.00% 3 Missing ⚠️
internal/llm/client.go 82.35% 2 Missing and 1 partial ⚠️
internal/data/sqlite/ddlmod.go 0.00% 1 Missing ⚠️
internal/ollama/pull.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #599      +/-   ##
==========================================
- Coverage   76.13%   76.09%   -0.05%     
==========================================
  Files          63       63              
  Lines       18579    18614      +35     
==========================================
+ Hits        14145    14164      +19     
- Misses       3758     3774      +16     
  Partials      676      676              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cpcloud cpcloud merged commit e78ed81 into main Mar 4, 2026
18 checks passed
@cpcloud cpcloud deleted the worktree-async-wobbling-valley branch March 4, 2026 12:17
cpcloud added a commit that referenced this pull request Mar 19, 2026
…serrcheck, noctx, wastedassign, intrange, wrapcheck, musttag (#599)

## Summary

- Enable 7 new golangci-lint linters: testifylint, rowserrcheck, noctx,
wastedassign, intrange, wrapcheck, musttag
- Add govulncheck as pre-commit hook and CI job with
`.govulncheck-exclude` for filtering vuln IDs with no upstream fix
- Add gosec G204/G704 exclusion for test files (controlled test binary
paths, not user input)
- Fix all existing violations across ~55 files

closes #596

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

chore(lint): add missing static analysis tools

1 participant