You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[plan] Enable new v2 linters: modernize, gocritic, and gosec #7379
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
New linters are enabled in .golangci.yml
make golint runs successfully
Critical issues found by new linters are fixed
Appropriate exclusions added for false positives
CI passes with new linters enabled
No excessive noise from new linters
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
Activity