From dca87c9e340fbd751e864d706a52c8db0d7caafe Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 3 Sep 2026 23:08:24 -0700 Subject: [PATCH] ci: bump golangci-lint to v2.13 Two things have to change together with the version, as neither is valid for v2.12: - The gofumpt extra-rules setting is deprecated in favor of the individual extra.* options; v2.12 rejects the latter (its config schema does not know them). Enable all three, which is what extra-rules: true used to mean, so the formatting stays the same. - The newer staticcheck flags the deprecated Hooks.Prestart and LinuxMemory.Kernel fields in the specconv tests. These exercise those fields on purpose, since runc still supports them, so silence it the same way as in the code under test. v2.12 does not report these, so nolintlint would call the directives unused there. Signed-off-by: Kir Kolyshkin --- .github/workflows/validate.yml | 2 +- .golangci.yml | 5 ++++- libcontainer/specconv/spec_linux_test.go | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 47877ee68..a091a29d5 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -53,7 +53,7 @@ jobs: sudo apt -qy install libseccomp-dev - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 with: - version: v2.12 + version: v2.13 skip-cache: true # Extra linters, only checking new code from a pull request to main. - name: lint-extra diff --git a/.golangci.yml b/.golangci.yml index 6fe213dfc..36a92fc42 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,7 +9,10 @@ formatters: - gofumpt settings: gofumpt: - extra-rules: true + extra: + balance-calls: true + clothe-returns: true + group-params: true linters: enable: diff --git a/libcontainer/specconv/spec_linux_test.go b/libcontainer/specconv/spec_linux_test.go index 3e532d490..4578f0115 100644 --- a/libcontainer/specconv/spec_linux_test.go +++ b/libcontainer/specconv/spec_linux_test.go @@ -32,7 +32,7 @@ func TestCreateCommandHookTimeout(t *testing.T) { func TestCreateHooks(t *testing.T) { rspec := &specs.Spec{ Hooks: &specs.Hooks{ - Prestart: []specs.Hook{ + Prestart: []specs.Hook{ //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. { Path: "/some/hook/path", }, @@ -364,7 +364,7 @@ func TestLinuxCgroupWithMemoryResource(t *testing.T) { Limit: &limit, Reservation: &reservation, Swap: &swap, - Kernel: &kernel, + Kernel: &kernel, //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. KernelTCP: &kernelTCP, Swappiness: swappinessPtr, DisableOOMKiller: &disableOOMKiller,