Skip to content

Conversation

odysseus0
Copy link

Summary

  • Migrates golangci-lint configuration to v2 schema
  • Optimizes CI by using golangci-lint-action@v8 (eliminates 93s compilation time)
  • Implements tools.go pattern for version consistency between local and CI
  • Fixes gosec warnings in health check handlers

Changes

Config Migration:

  • .golangci.yaml: Updated to v2 schema (default: all, nested linters.settings)
  • Disabled noisy linters: funcorder, noinlineerr, wsl_v5, complexity metrics
  • Kept tagliatelle enabled (new projects should enforce snake_case JSON tags)

CI Optimization:

  • .github/workflows/checks.yml: Use golangci-lint-action@v8 with pre-built binaries
  • Extract golangci-lint version from go.mod for local/CI parity
  • Remove manual make install-tools step (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)
  • Removed staticcheck (bundled in golangci-lint), added gci for import formatting

Bug Fixes:

  • httpserver/handler.go: Explicitly handle w.Write() errors to satisfy gosec

Test Plan

  • make install-tools - Tools install correctly from go.mod
  • make lint - 0 issues locally
  • make test - All tests pass
  • CI will verify golangci-lint-action works correctly

Learnings Applied

All changes are based on optimizations discovered while migrating protect-rpc from golangci-lint v2.1.2 to v2.5.0, where we:

  1. Discovered the tools.go pattern for version consistency
  2. Found golangci-lint-action eliminates 93s build time
  3. Learned v2 schema enforcement and linter configurations

🤖 Generated with Claude Code

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 <[email protected]>
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.

1 participant