Skip to content

ci(lint): adopt golangci-lint v2.14.0 tooling and strict lint config - #93

Merged
appleboy merged 1 commit into
masterfrom
ci/golangci-lint-tooling
Oct 3, 2026
Merged

appleboy merged 1 commit into
masterfrom
ci/golangci-lint-tooling

Conversation

@appleboy

@appleboy appleboy commented Oct 3, 2026

Copy link
Copy Markdown
Member

Summary

Adopt project-managed golangci-lint tooling (same approach as go-signet/signet) across build, lint config, and CI:

flowchart LR
    A[go.tools.mod<br/>pin golangci-lint v2.14.0] --> B[Makefile<br/>make lint / make fmt]
    B --> C[.golangci.yml<br/>strict v2 config]
    C --> D[GitHub Actions<br/>make install-tools lint]
    D --> E[Code fixes<br/>0 lint issues]
Loading

Additions

  • .golangci.yml — strict golangci-lint v2 configuration (bidichk, gocritic, modernize, revive, testifylint, perfsprint, staticcheck, etc.) with module-specific gci import ordering
  • Makefile — lint, fmt, test, coverage, mod-download/tidy/verify, install-tools, help targets
  • go.tools.mod / go.tools.sum — pin golangci-lint v2.14.0 via Go tool directive, executed with go tool -modfile=go.tools.mod

CI changes

  • Replace golangci/golangci-lint-action with make install-tools lint so local and CI use the exact same pinned version

Code fixes (all lint issues resolved: 0 issues)

  • Automated: modernize (interface{} → any, range over int, maps.Copy), usestdlibvars (http.MethodGet), perfsprint, testifylint (assert → require), usetesting (os.MkdirTemp → t.TempDir)
  • Manual: dead code removal, unused imports, builtin shadowing fixes
  • Public API names kept unchanged (e.g. exported funcs/fields) via //nolint directives with explanations for backward compatibility

AI Authorship Disclosure

🤖 This change was prepared with AI assistance. Generated with Claude Code.

Change Classification

  • Type: ci (tooling/CI) + style/refactor (lint fixes)
  • Scope: build/lint tooling, CI workflow, lint-driven code cleanup
  • Impact: No public API changes; no behavior changes

Checklist

  • make lint passes with 0 issues
  • Tests pass locally for affected repos
  • Public API names preserved for backward compatibility
  • CI workflow updated to use make lint

- Add .golangci.yml based on the signet strict configuration with module-specific gci prefix
- Add Makefile with lint, fmt, test, coverage and mod targets
- Pin golangci-lint v2.14.0 via go.tools.mod with tool directive
- Replace golangci-lint-action with make install-tools lint in CI workflow
- Apply automated lint fixes: modernize, usestdlibvars, perfsprint, testifylint
- Keep public API names unchanged via nolint directives for backward compatibility
- Replace os.MkdirTemp with t.TempDir in tests
- Clean up dead code and unused imports flagged by staticcheck and govet

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 3, 2026 01:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The pinned tooling, CI integration, configuration, and behavior-preserving cleanups are consistent and complete.

Review effort: Balanced
Findings: None

What changed in this PR

Adopts project-pinned golangci-lint v2.14.0 tooling, consistent local/CI lint commands, and lint-driven Go modernization without API changes.

Changes:

  • Adds pinned tooling, Make targets, and strict lint/format configuration.
  • Updates CI to use the project-managed linter.
  • Applies behavior-preserving source and test modernizations.
File Description
.golangci.yml Configures strict linting and formatting.
.github/​workflows/​go.yml Runs the pinned linter through Make.
Makefile Adds development and CI targets.
go.tools.mod Pins golangci-lint and tool dependencies.
go.tools.sum Locks tool dependency checksums.
writer.go Modernizes header copying.
timeout.go Modernizes types and header copying.
writer_test.go Applies safer assertions and modern syntax.
timeout_test.go Modernizes requests, assertions, and goroutines.
buffer_pool_test.go Modernizes loops and assertions.
_example/​example01/​main.go Applies configured import grouping.
_example/​example02/​main.go Applies configured import grouping.
_example/​example03/​main.go Applies configured import grouping.
_example/​example04/​main.go Applies configured import grouping.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@appleboy
appleboy merged commit 3abb36f into master Oct 3, 2026
9 of 10 checks passed
@appleboy
appleboy deleted the ci/golangci-lint-tooling branch October 3, 2026 01:16
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.

2 participants