diff --git a/hack/golangci-hints.yaml b/hack/golangci-hints.yaml index 58b382f0b2c..14551c28b5f 100644 --- a/hack/golangci-hints.yaml +++ b/hack/golangci-hints.yaml @@ -77,6 +77,17 @@ issues: text: comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)...|should have a package comment path-except: cmd/kubeadm + # The unused linter that comes from staticcheck currently does not handle types which implement + # a generic interface. The linter incorrectly reports the implementations of unexported + # interface methods as unused. See https://github.com/dominikh/go-tools/issues/1294. + # Rather than exporting the interface methods, which makes the error go away but changes the + # semantics of the code, we ignore this error for affected files. + # This can be removed when the staticcheck implementation of this rule is fixed, which may + # depend on https://github.com/golang/go/issues/63982. + - linters: + - unused + path: staging/src/k8s.io/client-go/util/workqueue/metrics.go + linters: disable-all: false enable: # please keep this alphabetized diff --git a/hack/golangci-strict.yaml b/hack/golangci-strict.yaml index a079e8c449a..499c503a15a 100644 --- a/hack/golangci-strict.yaml +++ b/hack/golangci-strict.yaml @@ -77,6 +77,17 @@ issues: text: comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)...|should have a package comment path-except: cmd/kubeadm + # The unused linter that comes from staticcheck currently does not handle types which implement + # a generic interface. The linter incorrectly reports the implementations of unexported + # interface methods as unused. See https://github.com/dominikh/go-tools/issues/1294. + # Rather than exporting the interface methods, which makes the error go away but changes the + # semantics of the code, we ignore this error for affected files. + # This can be removed when the staticcheck implementation of this rule is fixed, which may + # depend on https://github.com/golang/go/issues/63982. + - linters: + - unused + path: staging/src/k8s.io/client-go/util/workqueue/metrics.go + # The following issues were deemed "might be worth fixing, needs to be # decided on a case-by-case basis". This was initially decided by a # majority of the developers who voted in diff --git a/hack/golangci.yaml b/hack/golangci.yaml index 9c3a960a8c1..f542613ae20 100644 --- a/hack/golangci.yaml +++ b/hack/golangci.yaml @@ -83,6 +83,17 @@ issues: text: comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)...|should have a package comment path-except: cmd/kubeadm + # The unused linter that comes from staticcheck currently does not handle types which implement + # a generic interface. The linter incorrectly reports the implementations of unexported + # interface methods as unused. See https://github.com/dominikh/go-tools/issues/1294. + # Rather than exporting the interface methods, which makes the error go away but changes the + # semantics of the code, we ignore this error for affected files. + # This can be removed when the staticcheck implementation of this rule is fixed, which may + # depend on https://github.com/golang/go/issues/63982. + - linters: + - unused + path: staging/src/k8s.io/client-go/util/workqueue/metrics.go + # The following issues were deemed "might be worth fixing, needs to be # decided on a case-by-case basis". This was initially decided by a # majority of the developers who voted in diff --git a/hack/golangci.yaml.in b/hack/golangci.yaml.in index 2501fdf0831..df9d4b435ff 100644 --- a/hack/golangci.yaml.in +++ b/hack/golangci.yaml.in @@ -86,6 +86,17 @@ issues: text: comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)...|should have a package comment path-except: cmd/kubeadm + # The unused linter that comes from staticcheck currently does not handle types which implement + # a generic interface. The linter incorrectly reports the implementations of unexported + # interface methods as unused. See https://github.com/dominikh/go-tools/issues/1294. + # Rather than exporting the interface methods, which makes the error go away but changes the + # semantics of the code, we ignore this error for affected files. + # This can be removed when the staticcheck implementation of this rule is fixed, which may + # depend on https://github.com/golang/go/issues/63982. + - linters: + - unused + path: staging/src/k8s.io/client-go/util/workqueue/metrics.go + {{- if not .Hints}} # The following issues were deemed "might be worth fixing, needs to be