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.
This commit is contained in:
Patrick Ohly
2025-02-26 15:52:08 +01:00
committed by cpanato
parent 43509b63d7
commit 650db7fab9
2 changed files with 39 additions and 0 deletions

View File

@@ -73,6 +73,24 @@ issues:
- ginkgolinter
text: use a function call in (Eventually|Consistently)
# Some of these seem legitimate, maybe better fix code (https://github.com/kubernetes/kubernetes/issues/130449).
- linters:
- govet
text: "lostcancel|printf"
- linters:
- ginkgolinter
text: "wrong error assertion. Consider using `gomega.(Eventually|Consistently)|wrong comparison assertion|wrong length assertion"
- linters:
- testifylint
text: "encoded-compare|error-nil|formatter"
- linters:
- gocritic
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"
# https://github.com/kubernetes/kubernetes/issues/117288#issuecomment-1507012435
- linters:
- gocritic

View File

@@ -76,6 +76,27 @@ issues:
- ginkgolinter
text: use a function call in (Eventually|Consistently)
{{- if .Base}}
# Some of these seem legitimate, maybe better fix code (https://github.com/kubernetes/kubernetes/issues/130449).
- linters:
- govet
text: "lostcancel|printf"
- linters:
- ginkgolinter
text: "wrong error assertion. Consider using `gomega.(Eventually|Consistently)|wrong comparison assertion|wrong length assertion"
- linters:
- testifylint
text: "encoded-compare|error-nil|formatter"
- linters:
- gocritic
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"
{{- end}}
# https://github.com/kubernetes/kubernetes/issues/117288#issuecomment-1507012435
- linters:
- gocritic