mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
ci: bump to golangci-lint v2.0
The new configuration file was initially generated by golangci-lint migrate, when tweaked to minimize and simplify. golangci-lint v2 switches to a new version of staticcheck which shows much more warnings. Some of them were fixed by a few previous commits, and the rest of them are disabled. In particular, ST1005 had to be disabled (an attempt to fix it was made in https://github.com/opencontainers/runc/pull/3857 but it wasn't merged). Also, golangci-extra was modified to include ALL staticcheck linters. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -38,9 +38,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo apt -q update
|
sudo apt -q update
|
||||||
sudo apt -qy install libseccomp-dev
|
sudo apt -qy install libseccomp-dev
|
||||||
- uses: golangci/golangci-lint-action@v6
|
- uses: golangci/golangci-lint-action@v7
|
||||||
with:
|
with:
|
||||||
version: v1.64
|
version: v2.0
|
||||||
# Extra linters, only checking new code from a pull request.
|
# Extra linters, only checking new code from a pull request.
|
||||||
- name: lint-extra
|
- name: lint-extra
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
|
|||||||
+7
-1
@@ -3,13 +3,19 @@
|
|||||||
#
|
#
|
||||||
# For the default linter config, see .golangci.yml. This config should
|
# For the default linter config, see .golangci.yml. This config should
|
||||||
# only enable additional linters not enabled in the default config.
|
# only enable additional linters not enabled in the default config.
|
||||||
|
version: "2"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
build-tags:
|
build-tags:
|
||||||
- seccomp
|
- seccomp
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
default: none
|
||||||
enable:
|
enable:
|
||||||
- godot
|
- godot
|
||||||
- revive
|
- revive
|
||||||
|
- staticcheck
|
||||||
|
settings:
|
||||||
|
staticcheck:
|
||||||
|
checks:
|
||||||
|
- all
|
||||||
|
|||||||
+19
-7
@@ -1,18 +1,30 @@
|
|||||||
# For documentation, see https://golangci-lint.run/usage/configuration/
|
version: "2"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
build-tags:
|
build-tags:
|
||||||
- seccomp
|
- seccomp
|
||||||
|
|
||||||
linters:
|
formatters:
|
||||||
enable:
|
enable:
|
||||||
- gofumpt
|
- gofumpt
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
- errorlint
|
- errorlint
|
||||||
- nolintlint
|
- nolintlint
|
||||||
- unconvert
|
- unconvert
|
||||||
- unparam
|
- unparam
|
||||||
|
settings:
|
||||||
linters-settings:
|
govet:
|
||||||
govet:
|
enable:
|
||||||
enable:
|
- nilness
|
||||||
- nilness
|
staticcheck:
|
||||||
|
checks:
|
||||||
|
- all
|
||||||
|
- -ST1000 # https://staticcheck.dev/docs/checks/#ST1000 Incorrect or missing package comment.
|
||||||
|
- -ST1003 # https://staticcheck.dev/docs/checks/#ST1003 Poorly chosen identifier.
|
||||||
|
- -ST1005 # https://staticcheck.dev/docs/checks/#ST1005 Incorrectly formatted error string.
|
||||||
|
- -QF1008 # https://staticcheck.dev/docs/checks/#QF1008 Omit embedded fields from selector expression.
|
||||||
|
exclusions:
|
||||||
|
presets:
|
||||||
|
- std-error-handling
|
||||||
|
|||||||
Reference in New Issue
Block a user