-
Notifications
You must be signed in to change notification settings - Fork 220
Closed
Labels
Description
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.ymlconfiguration - 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 conversionsFiles 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=modernizeAcceptance Criteria
- New linters are enabled in
.golangci.yml -
make golintruns 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
AI generated by Plan Command for discussion #7356
Reactions are currently unavailable