diff --git a/build.env b/build.env index 0f474fbe1..3e2c59aa8 100644 --- a/build.env +++ b/build.env @@ -26,7 +26,7 @@ GO111MODULE=on COMMITLINT_VERSION=latest # static checks and linters -GOLANGCI_VERSION=v1.57.2 +GOLANGCI_VERSION=v1.62.2 # external snapshotter version # Refer: https://github.com/kubernetes-csi/external-snapshotter/releases diff --git a/e2e/rbd_helper.go b/e2e/rbd_helper.go index 786660722..7a00871e8 100644 --- a/e2e/rbd_helper.go +++ b/e2e/rbd_helper.go @@ -36,7 +36,7 @@ import ( "k8s.io/kubernetes/test/e2e/framework" ) -//nolint:gomnd // numbers specify Kernel versions. +//nolint:mnd // numbers specify Kernel versions. var nbdResizeSupport = []util.KernelVersion{ { Version: 5, @@ -48,7 +48,7 @@ var nbdResizeSupport = []util.KernelVersion{ }, // standard 5.3+ versions } -//nolint:gomnd // numbers specify Kernel versions. +//nolint:mnd // numbers specify Kernel versions. var fastDiffSupport = []util.KernelVersion{ { Version: 5, @@ -60,7 +60,7 @@ var fastDiffSupport = []util.KernelVersion{ }, // standard 5.3+ versions } -//nolint:gomnd // numbers specify Kernel versions. +//nolint:mnd // numbers specify Kernel versions. var deepFlattenSupport = []util.KernelVersion{ { Version: 5, @@ -75,7 +75,7 @@ var deepFlattenSupport = []util.KernelVersion{ // To use `io-timeout=0` we need // www.mail-archive.com/linux-block@vger.kernel.org/msg38060.html // -//nolint:gomnd // numbers specify Kernel versions. +//nolint:mnd // numbers specify Kernel versions. var nbdZeroIOtimeoutSupport = []util.KernelVersion{ { Version: 5, diff --git a/internal/cephfs/mounter/volumemounter.go b/internal/cephfs/mounter/volumemounter.go index 986ac6ee6..edf85f5d0 100644 --- a/internal/cephfs/mounter/volumemounter.go +++ b/internal/cephfs/mounter/volumemounter.go @@ -31,7 +31,7 @@ import ( var ( availableMounters []string - //nolint:gomnd // numbers specify Kernel versions. + //nolint:mnd // numbers specify Kernel versions. quotaSupport = []util.KernelVersion{ { Version: 4, diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index 905fcf8af..5702ad050 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -76,7 +76,7 @@ var ( kernelRelease = "" // deepFlattenSupport holds the list of kernel which support mapping rbd // image with deep-flatten image feature - //nolint:gomnd // numbers specify Kernel versions. + //nolint:mnd // numbers specify Kernel versions. deepFlattenSupport = []util.KernelVersion{ { Version: 5, diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index d1fc4a328..274981bfe 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -1793,7 +1793,7 @@ func (ri *rbdImageMetadataStash) String() string { func stashRBDImageMetadata(volOptions *rbdVolume, metaDataPath string) error { imgMeta := rbdImageMetadataStash{ // there are no checks for this at present - Version: 3, //nolint:gomnd // number specifies version. + Version: 3, //nolint:mnd // number specifies version. Pool: volOptions.Pool, RadosNamespace: volOptions.RadosNamespace, ImageName: volOptions.RbdImageName, diff --git a/scripts/golangci.yml.in b/scripts/golangci.yml.in index d96739ed3..fbdfd2267 100644 --- a/scripts/golangci.yml.in +++ b/scripts/golangci.yml.in @@ -128,6 +128,10 @@ linters-settings: - dupImport # https://github.com/go-critic/go-critic/issues/845 # TODO: uncheckedInlineErr gives many false-positives - uncheckedInlineErr + gosec: + excludes: + # TODO: G115 gives many false-positives + - G115 # Potential integer overflow when converting between integer types unused: # treat code as a program (not a library) and report unused exported # identifiers; default is false. @@ -197,6 +201,7 @@ linters: - wrapcheck # TODO: enable linters added in golangci-lint 1.43 - contextcheck + - mnd - gomnd - ireturn - tagliatelle @@ -208,3 +213,6 @@ linters: - containedctx # TODO: depguard requires a list of (un)acceptable imports - depguard + # TODO enable linters added in golangci-lint 1.60 + - iface + - recvcheck