hack: verify golangci-lint config, update text

This commit is contained in:
Oleksandr Redko 2025-03-10 12:06:56 +02:00
parent 834a0d92cf
commit a9d558de26
4 changed files with 9 additions and 4 deletions

View File

@ -205,7 +205,7 @@ linters-settings: # please keep this alphabetized
msg: should not be used because managedFields was removed
- p: \.Add$
pkg: ^k8s\.io/component-base/featuregate$
msg: should not use MutableFeatureGate.Add, use AddVersioned instead
msg: should not use Add, use AddVersioned instead
- p: ^gomega\.BeTrue$
pkg: ^github.com/onsi/gomega$
msg: "it does not produce a good failure message - use BeTrueBecause with an explicit printf-style failure message instead, or plain Go: if ... { ginkgo.Fail(...) }"

View File

@ -271,7 +271,7 @@ linters-settings: # please keep this alphabetized
msg: should not be used because managedFields was removed
- p: \.Add$
pkg: ^k8s\.io/component-base/featuregate$
msg: should not use MutableFeatureGate.Add, use AddVersioned instead
msg: should not use Add, use AddVersioned instead
gocritic:
enabled-checks:
- equalFold

View File

@ -223,7 +223,7 @@ linters-settings: # please keep this alphabetized
msg: should not be used because managedFields was removed
- p: \.Add$
pkg: ^k8s\.io/component-base/featuregate$
msg: should not use MutableFeatureGate.Add, use AddVersioned instead
msg: should not use Add, use AddVersioned instead
{{- if .Hints}}
- p: ^gomega\.BeTrue$
pkg: ^github.com/onsi/gomega$

View File

@ -15,7 +15,7 @@
# limitations under the License.
# This script checks that all generated golangci-lint configurations
# are up-to-date.
# are up-to-date and the config hack/golangci.yaml is valid.
set -o errexit
set -o nounset
@ -24,4 +24,9 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/verify-generated.sh"
golangci=("${GOBIN}/golangci-lint")
golangci_config="${KUBE_ROOT}/hack/golangci.yaml"
kube::verify::generated "" "Please run 'hack/update-golangci-lint-config.sh'" hack/update-golangci-lint-config.sh
"${golangci[@]}" config verify --config="${golangci_config}"