Merge pull request #5341 from kolyshkin/modernize-to-lint

ci: bump golangci-lint, move modernize/govet to linters
This commit is contained in:
lfbzhm
2026-06-24 13:54:30 +08:00
committed by GitHub
2 changed files with 3 additions and 24 deletions
+1 -24
View File
@@ -44,7 +44,7 @@ jobs:
sudo apt -qy install libseccomp-dev sudo apt -qy install libseccomp-dev
- uses: golangci/golangci-lint-action@v9 - uses: golangci/golangci-lint-action@v9
with: with:
version: v2.10 version: v2.12
skip-cache: true skip-cache: true
# Extra linters, only checking new code from a pull request to main. # Extra linters, only checking new code from a pull request to main.
- name: lint-extra - name: lint-extra
@@ -52,28 +52,6 @@ jobs:
run: | run: |
golangci-lint run --config .golangci-extra.yml --new-from-rev=HEAD~1 golangci-lint run --config .golangci-extra.yml --new-from-rev=HEAD~1
modernize:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 2
- uses: actions/setup-go@v6
with:
go-version: stable # modernize@latest may require latest Go.
- name: install deps
run: |
sudo apt -q update
sudo apt -qy install libseccomp-dev
- name: run go fix
run: |
go fix ./...
git diff --exit-code
- name: run modernize
run: |
go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest -fix ./...
git diff --exit-code
compile-buildtags: compile-buildtags:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
env: env:
@@ -328,7 +306,6 @@ jobs:
- get-images - get-images
- keyring - keyring
- lint - lint
- modernize
- release - release
- shellcheck - shellcheck
- shfmt - shfmt
+2
View File
@@ -15,6 +15,8 @@ linters:
enable: enable:
- errorlint - errorlint
- forbidigo - forbidigo
- govet
- modernize
- nolintlint - nolintlint
- unconvert - unconvert
- unparam - unparam