Преглед изворни кода

golangci-lint: update to v1.49.0

Remove the "deadcode", "structcheck", and "varcheck" linters, as they are
deprecated:

    WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
    WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
    WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
    WARN [linters context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2f1c382a6ddb988cf968c0eac1c2c0884826e214)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3ce520ec8038cf322bea1f6d6fb31527172e1b89)
Signed-off-by: Cory Snider <csnider@mirantis.com>
Sebastiaan van Stijn пре 2 година
родитељ
комит
6b1c02b983

+ 0 - 1
daemon/graphdriver/vfs/quota_linux.go

@@ -5,7 +5,6 @@ import (
 	"github.com/sirupsen/logrus"
 )
 
-//nolint:structcheck
 type driverQuota struct {
 	quotaCtl *quota.Control
 	quotaOpt quota.Quota

+ 1 - 1
hack/dockerfile/install/golangci_lint.installer

@@ -1,6 +1,6 @@
 #!/bin/sh
 
-: "${GOLANGCI_LINT_VERSION=v1.46.2}"
+: "${GOLANGCI_LINT_VERSION=v1.49.0}"
 
 install_golangci_lint() {
 	set -e

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

@@ -1,6 +1,5 @@
 linters:
   enable:
-    - deadcode
     - goimports
     - gosec
     - gosimple
@@ -9,11 +8,9 @@ linters:
     - misspell
     - revive
     - staticcheck
-    - structcheck
     - typecheck
     - unconvert
     - unused
-    - varcheck
 
   disable:
     - errcheck
@@ -28,7 +25,11 @@ linters:
 linters-settings:
   govet:
     check-shadowing: false
-
+  revive:
+    rules:
+      # FIXME make sure all packages have a description. Currently, there's many packages without.
+      - name: package-comments
+        disabled: true
 issues:
   # The default exclusion rules are a bit too permissive, so copying the relevant ones below
   exclude-use-default: false

+ 1 - 1
pkg/devicemapper/devmapper.go

@@ -16,7 +16,7 @@ import (
 
 // Same as DM_DEVICE_* enum values from libdevmapper.h
 //
-//nolint:deadcode,unused,varcheck
+//nolint:unused
 const (
 	deviceCreate TaskType = iota
 	deviceReload

+ 1 - 1
volume/drivers/extpoint.go

@@ -22,7 +22,7 @@ const extName = "VolumeDriver"
 // This interface is only defined to generate the proxy objects.
 // It's not intended to be public or reused.
 //
-//nolint:deadcode,unused,varcheck
+//nolint:unused
 type volumeDriver interface {
 	// Create a volume with the given name
 	Create(name string, opts map[string]string) (err error)