Skip to content

Commit 650db7f

Browse files
pohlycpanato
authored andcommitted
golangci-lint: temporarily suppress known issues in the code base
These suppressions are necessary to make golangci-lint 1.64 pass with the current code base. This change is meant to be backported to release branches. On master, we may want to revert some of it together with fixing the findings.
1 parent 43509b6 commit 650db7f

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

hack/golangci.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,24 @@ issues:
7373
- ginkgolinter
7474
text: use a function call in (Eventually|Consistently)
7575

76+
# Some of these seem legitimate, maybe better fix code (https://github.com/kubernetes/kubernetes/issues/130449).
77+
78+
- linters:
79+
- govet
80+
text: "lostcancel|printf"
81+
82+
- linters:
83+
- ginkgolinter
84+
text: "wrong error assertion. Consider using `gomega.(Eventually|Consistently)|wrong comparison assertion|wrong length assertion"
85+
86+
- linters:
87+
- testifylint
88+
text: "encoded-compare|error-nil|formatter"
89+
90+
- linters:
91+
- gocritic
92+
text: "append result not assigned to the same slice|put a space between `//` and comment text|sloppyLen|elseif|should rewrite switch statement to if statement|regexpMust|wrapperFunc: use strings.ReplaceAll|singleCaseSwitch|deprecatedComment|exitAfterDefer|captLocal|unlambda|underef|unslice|valSwap|typeSwitchVar"
93+
7694
# https://github.com/kubernetes/kubernetes/issues/117288#issuecomment-1507012435
7795
- linters:
7896
- gocritic

hack/golangci.yaml.in

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@ issues:
7676
- ginkgolinter
7777
text: use a function call in (Eventually|Consistently)
7878

79+
{{- if .Base}}
80+
81+
# Some of these seem legitimate, maybe better fix code (https://github.com/kubernetes/kubernetes/issues/130449).
82+
83+
- linters:
84+
- govet
85+
text: "lostcancel|printf"
86+
87+
- linters:
88+
- ginkgolinter
89+
text: "wrong error assertion. Consider using `gomega.(Eventually|Consistently)|wrong comparison assertion|wrong length assertion"
90+
91+
- linters:
92+
- testifylint
93+
text: "encoded-compare|error-nil|formatter"
94+
95+
- linters:
96+
- gocritic
97+
text: "append result not assigned to the same slice|put a space between `//` and comment text|sloppyLen|elseif|should rewrite switch statement to if statement|regexpMust|wrapperFunc: use strings.ReplaceAll|singleCaseSwitch|deprecatedComment|exitAfterDefer|captLocal|unlambda|underef|unslice|valSwap|typeSwitchVar"
98+
{{- end}}
99+
79100
# https://github.com/kubernetes/kubernetes/issues/117288#issuecomment-1507012435
80101
- linters:
81102
- gocritic

0 commit comments

Comments
 (0)