Objective
Enable valuable new linters that are available in golangci-lint v2 to improve code quality and catch more issues.
Context
golangci-lint v2 includes several new linters that can help improve the codebase. This task enables the most valuable ones without being overly noisy.
Approach
- Add new linters to
.golangci.yml configuration
- Run linters locally to see what issues are found
- Fix any critical issues found
- Add appropriate exclusions for false positives if needed
- Document why each linter is enabled
Linters to Enable
linters:
enable:
# Existing linters...
- modernize # Modern Go patterns (NEW in v2.6.0)
- gocritic # Comprehensive opinionated linter
- gosec # Security-focused (already in tools.go)
- godot # Comment punctuation
- unconvert # Remove unnecessary conversions
Files to Modify
.golangci.yml - Add linters to enable list
- Source code files - Fix any issues found by new linters (as needed)
Testing Commands
# Test new linters locally
golangci-lint run --enable=modernize,gocritic,gosec,godot,unconvert
# Run full linting suite
make golint
# Check specific linter output
golangci-lint run --enable=modernize
Acceptance Criteria
Expected Issues
New linters may find:
- Opportunities for modern Go patterns (modernize)
- Code style improvements (gocritic)
- Security vulnerabilities (gosec)
- Missing comment punctuation (godot)
- Unnecessary type conversions (unconvert)
Notes
Start with just these 5 linters. Additional linters can be enabled in future iterations based on value vs. noise ratio.
Related to #7375
AI generated by Plan Command for discussion #7356
Objective
Enable valuable new linters that are available in golangci-lint v2 to improve code quality and catch more issues.
Context
golangci-lint v2 includes several new linters that can help improve the codebase. This task enables the most valuable ones without being overly noisy.
Approach
.golangci.ymlconfigurationLinters to Enable
Files to Modify
.golangci.yml- Add linters to enable listTesting Commands
Acceptance Criteria
.golangci.ymlmake golintruns successfullyExpected Issues
New linters may find:
Notes
Start with just these 5 linters. Additional linters can be enabled in future iterations based on value vs. noise ratio.
Related to #7375