mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 07:13:53 +00:00
hack: disable gomega.Consistently/Eventually check due to false positives
For example, this is a false positive that currently exists in the code base: test/e2e_node/dra_test.go:129:4: ginkgo-linter: use a function call in Consistently. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed; consider using `gomega.Consistently(ctx, e2epod.Get).WithArguments(f.ClientSet, pod).WithTimeout(podInPendingStateTimeout).Should(e2epod.BeInPhase(v1.PodPending), "Pod should be in Pending state as resource preparation time outed")` instead (ginkgolinter) gomega.Consistently(ctx, e2epod.Get(f.ClientSet, pod)).WithTimeout(podInPendingStateTimeout).Should(e2epod.BeInPhase(v1.PodPending), ^ It's a false positive because e2epod.Get returns the function that Consistently is meant to call. This could be worked around by assigning e2epod.Get(f.ClientSet, pod) to a variable and then use that variable, but that is less readable.
This commit is contained in:
parent
f618e61332
commit
1af5425696
@ -21,6 +21,10 @@ issues:
|
||||
- linters:
|
||||
- stylecheck
|
||||
text: "ST1003: should not use underscores in Go names; func (Convert_.*_To_.*|SetDefaults_)"
|
||||
# This check currently has some false positives (https://github.com/nunnatsa/ginkgolinter/issues/91).
|
||||
- linters:
|
||||
- ginkgolinter
|
||||
text: use a function call in (Eventually|Consistently)
|
||||
|
||||
linters:
|
||||
disable-all: false # in contrast to golangci.yaml, the default set of linters remains enabled
|
||||
|
@ -22,6 +22,10 @@ issues:
|
||||
- linters:
|
||||
- stylecheck
|
||||
text: "ST1003: should not use underscores in Go names; func (Convert_.*_To_.*|SetDefaults_)"
|
||||
# This check currently has some false positives (https://github.com/nunnatsa/ginkgolinter/issues/91).
|
||||
- linters:
|
||||
- ginkgolinter
|
||||
text: use a function call in (Eventually|Consistently)
|
||||
|
||||
linters:
|
||||
disable-all: true # not disabled in golangci-strict.yaml
|
||||
|
Loading…
Reference in New Issue
Block a user