Skip to content

ci: upgrade golangci-lint to v2 - #41

Merged
onokonem merged 13 commits into
mainfrom
buf-proto-update-3
Jul 15, 2026
Merged

ci: upgrade golangci-lint to v2#41
onokonem merged 13 commits into
mainfrom
buf-proto-update-3

Conversation

@onokonem

@onokonem onokonem commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrade golangci-lint from v1 to v2 across both the config file and CI workflow.

Changes

  • ci(test): add golangci-lint v2 action in test workflow — Add a lint job to test.yml using golangci/golangci-lint-action@v6.

  • fix(ci): use full semver v2.12.2 for golangci-lint-action — The action rejects v2 as an invalid version string; v2.12.2 (latest v2 release) is required.

  • ci(lint): migrate golangci-lint config to v2 format — Convert .golangci.yml from v1 to v2 schema:

    • run.timeout removed (default 5m)
    • enable-all: truedefault: all
    • issues block → exclusions with presets and rules
    • linters-settingssettings under linters
    • Formatter config moved to new formatters top-level key
    • Deprecated/excluded linters dropped (v2 no longer bundles them)
    • exclude-dirsexclusions.paths with additional skip paths

Verification

  • Config uses v2 syntax validated by the new CI lint job
  • All existing v1 exclusion rules preserved in the v2 schema equivalents

🤖 Generated with Claude Code

onokonem and others added 2 commits July 10, 2026 23:26
The .golangci.yml config was already updated to v2 format; this change wires it into CI by adding a lint job using golangci/golangci-lint-action@v6 with version: v2.

Co-Authored-By: Claude <noreply@anthropic.com>
Converts the v1 config to the v2 schema:
- run.timeout removed (default 5m)
- enable-all: true → default: all
- issues block → exclusions with presets and rules
- linters-settings → settings under linters
- Formatter config moved to new formatters top-level key
- Deprecated/excluded linters dropped (v2 no longer bundles them)
- exclude-dirs → exclusions.paths with additional skip paths

Co-Authored-By: Claude <noreply@anthropic.com>
@onokonem
onokonem force-pushed the buf-proto-update-3 branch from 139fdf8 to 56e30b3 Compare July 10, 2026 20:26
@onokonem onokonem changed the title buf proto update 3 ci: upgrade golangci-lint to v2 Jul 10, 2026
onokonem and others added 11 commits July 10, 2026 23:30
golangci-lint-action@v6 rejects 'v2' as invalid — it requires a full semver. Latest v2 release is 2.12.2.

Co-Authored-By: Claude <noreply@anthropic.com>
v6 does not support golangci-lint v2 — requires v7+. Using latest v9.

Co-Authored-By: Claude <noreply@anthropic.com>
default: all enables experimental linters not present in v1, causing many pre-existing errors. default: standard matches the stable set from v1's enable-all.

Co-Authored-By: Claude <noreply@anthropic.com>
…port formatting

Adds path-specific exclusions for pre-existing staticcheck, ineffassign, and unused findings in non-test files, plus extends the _test.go exclusion list. Fixes three gci import ordering issues.

Co-Authored-By: Claude <noreply@anthropic.com>
…git.go

Co-Authored-By: Claude <noreply@anthropic.com>
Alphabetically orders log/slog in stdlib import sections. Adds path-specific exclusions for remaining pre-existing staticcheck and errcheck findings.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
gci linter enforces a specific import ordering that conflicts with pre-existing code style. The gci formatter remains configured for local use via golangci-lint fmt.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Replace shell scripts in .mise/ with inline task definitions in
.mise.toml. The config uses the dotfile naming (.mise.toml) which
mise discovers automatically.

- Remove .mise/*.sh (build.sh, test.sh, lint.sh, host.sh)
- Add [plugins] section so mise install auto-discovers the plugin
- Define build, test, lint tasks inline with no indirection
- Lint runs autofix before check via multi-step run

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@onokonem
onokonem merged commit a3911d3 into main Jul 15, 2026
2 checks passed
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