diff --git a/hack/golangci-hints.yaml b/hack/golangci-hints.yaml index 28bf2dff9a0..fed4241f4ff 100644 --- a/hack/golangci-hints.yaml +++ b/hack/golangci-hints.yaml @@ -150,6 +150,12 @@ linters-settings: # please keep this alphabetized - p: \.Extract pkg: ^k8s\.io/client-go/applyconfigurations/ msg: should not be used because managedFields was removed + - 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(...) }" + - p: ^gomega\.BeFalse$ + pkg: ^github.com/onsi/gomega$ + msg: "it does not produce a good failure message - use BeFalseBecause with an explicit printf-style failure message instead, or plain Go: if ... { ginkgo.Fail(...) }" revive: # Only these rules are enabled. rules: diff --git a/hack/golangci.yaml.in b/hack/golangci.yaml.in index c2284551c75..0b556cf5cf4 100644 --- a/hack/golangci.yaml.in +++ b/hack/golangci.yaml.in @@ -171,6 +171,14 @@ linters-settings: # please keep this alphabetized - p: \.Extract pkg: ^k8s\.io/client-go/applyconfigurations/ msg: should not be used because managedFields was removed + {{- if .Hints}} + - 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(...) }" + - p: ^gomega\.BeFalse$ + pkg: ^github.com/onsi/gomega$ + msg: "it does not produce a good failure message - use BeFalseBecause with an explicit printf-style failure message instead, or plain Go: if ... { ginkgo.Fail(...) }" + {{- end}} {{- if .Base }} gocritic: enabled-checks: