Sfoglia il codice sorgente

Merge pull request #46332 from thaJeztah/23.0_backport_update_golangci_lint

[23.0 backport] update golangci-lint to v1.54.2
Sebastiaan van Stijn 1 anno fa
parent
commit
66b3a81031
3 ha cambiato i file con 7 aggiunte e 8 eliminazioni
  1. 1 1
      Dockerfile
  2. 1 1
      daemon/logger/splunk/splunk.go
  3. 5 6
      hack/validate/golangci-lint.yml

+ 1 - 1
Dockerfile

@@ -222,7 +222,7 @@ FROM binary-dummy AS containerd-windows
 FROM containerd-${TARGETOS} AS containerd
 
 FROM base AS golangci_lint
-ARG GOLANGCI_LINT_VERSION=v1.51.2
+ARG GOLANGCI_LINT_VERSION=v1.54.2
 RUN --mount=type=cache,target=/root/.cache/go-build \
     --mount=type=cache,target=/go/pkg/mod \
         GOBIN=/build/ GO111MODULE=on go install "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}" \

+ 1 - 1
daemon/logger/splunk/splunk.go

@@ -37,7 +37,7 @@ const (
 	splunkCANameKey               = "splunk-caname"
 	splunkInsecureSkipVerifyKey   = "splunk-insecureskipverify"
 	splunkFormatKey               = "splunk-format"
-	splunkVerifyConnectionKey     = "splunk-verify-connection"
+	splunkVerifyConnectionKey     = "splunk-verify-connection" // #nosec G101 -- ignoring: Potential hardcoded credentials (gosec)
 	splunkGzipCompressionKey      = "splunk-gzip"
 	splunkGzipCompressionLevelKey = "splunk-gzip-level"
 	splunkIndexAcknowledgment     = "splunk-index-acknowledgment"

+ 5 - 6
hack/validate/golangci-lint.yml

@@ -27,12 +27,11 @@ linters-settings:
   govet:
     check-shadowing: false
   depguard:
-    list-type: blacklist
-    include-go-root: true
-    packages:
-      # The io/ioutil package has been deprecated.
-      # https://go.dev/doc/go1.16#ioutil
-      - io/ioutil
+    rules:
+      main:
+        deny:
+          - pkg: io/ioutil
+            desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
   revive:
     rules:
       # FIXME make sure all packages have a description. Currently, there's many packages without.