mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
ci: replace modernize job with golangci linters
Instead of using a standalone modernize (and a separate job), add modernize and go vet (which should be same-as/similar-to go fix) linters to golangci-lint config. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ linters:
|
|||||||
enable:
|
enable:
|
||||||
- errorlint
|
- errorlint
|
||||||
- forbidigo
|
- forbidigo
|
||||||
|
- govet
|
||||||
|
- modernize
|
||||||
- nolintlint
|
- nolintlint
|
||||||
- unconvert
|
- unconvert
|
||||||
- unparam
|
- unparam
|
||||||
|
|||||||
Reference in New Issue
Block a user