-
Notifications
You must be signed in to change notification settings - Fork 9
Migrate to golangci-lint v2 and optimize CI/CD #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Apply all learnings from protect-rpc optimization work: **Config changes:** - Migrate .golangci.yaml to v2 schema (default: all, nested settings) - Disable noisy linters: funcorder, noinlineerr, wsl_v5, complexity metrics - Keep tagliatelle enabled (new projects should use snake_case JSON) **CI optimization:** - Use golangci-lint-action@v8 (pre-built binaries, no compilation) - Extract version from go.mod for local/CI consistency - Simplify workflow by removing manual tool installation **Tool management:** - Add tools/tools.go with blank imports (single source of truth) - Remove staticcheck (bundled in golangci-lint) - Add gci for import formatting - Simplify Makefile to use go.mod versions **Bug fixes:** - Fix gosec warnings: explicitly handle w.Write() errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
@claude please review this PR |
|
Claude finished @metachris's task in 1m 16s —— View job PR Review: golangci-lint v2 MigrationOverall this is a well-structured migration to golangci-lint v2 with good CI optimizations. The changes follow best practices for tool version management. Below are my detailed findings. ✅ What Looks Good1. CI Workflow Optimization (
2. tools.go Pattern (
3. Makefile Improvements
4. gosec Fix (
5. .gitignore Update
|
0536ea0 to
27263ef
Compare
Summary
Changes
Config Migration:
.golangci.yaml: Updated to v2 schema (default: all, nestedlinters.settings)CI Optimization:
.github/workflows/checks.yml: Use golangci-lint-action@v8 with pre-built binariesmake install-toolsstep (action handles it)Tool Management:
tools/tools.go: New file with blank imports (single source of truth for tool versions)Makefile: Simplified to use go.mod versions (removed @Version suffixes)Bug Fixes:
httpserver/handler.go: Explicitly handle w.Write() errors to satisfy gosecTest Plan
make install-tools- Tools install correctly from go.modmake lint- 0 issues locallymake test- All tests passLearnings Applied
All changes are based on optimizations discovered while migrating protect-rpc from golangci-lint v2.1.2 to v2.5.0, where we:
🤖 Generated with Claude Code