1+ version : " 2"
12run :
2- allow-parallel-runners : true
3- modules-download-mode : readonly
4- # Increase the default deadline from 1m as some module operations can take a
5- # while if uncached!
6- timeout : 10m
73 go : " 1.24"
8-
4+ timeout : 10m
5+ modules-download-mode : readonly
6+ allow-parallel-runners : true
97linters :
108 # sync from https://github.com/kubernetes-sigs/controller-runtime/blob/main/.golangci.yml
11- disable-all : true
9+ default : none
1210 enable :
1311 - asasalint
1412 - asciicheck
@@ -25,10 +23,7 @@ linters:
2523 - goconst
2624 - gocritic
2725 - gocyclo
28- - gofmt
29- - goimports
3026 - goprintffuncname
31- - gosimple
3227 - govet
3328 - importas
3429 - ineffassign
@@ -40,74 +35,95 @@ linters:
4035 - prealloc
4136 - revive
4237 - staticcheck
43- - stylecheck
4438 - tagliatelle
45- - typecheck
4639 - unconvert
4740 - unparam
4841 - unused
4942 - whitespace
50-
51- issues :
52- exclude-rules :
53- # Dot imports for gomega and ginkgo are allowed
54- # within test files.
55- - path : _test\.go
56- text : should not use dot imports
57- # Ignore error type switch case
58- - path : " pkg/loader/loader.go"
59- linters :
60- - errorlint
61- # Ignore test files
62- - linters :
63- - dupl
64- - ginkgolinter
65- path : _test\.go
66- - linters :
67- - gocritic
68- path : " pkg/markers/help.go"
69- - linters :
70- - exhaustive
71- path : " pkg/markers/parse.go|pkg/deepcopy/traverse.go|pkg/genall/help/types.go|pkg/crd/schema.go|pkg/crd/flatten.go"
72- # Ignore consider pre-allocating variables
73- - linters :
74- - prealloc
75- text : Consider pre-allocating
76- linters-settings :
77- govet :
78- enable-all : true
79- disable :
80- - fieldalignment
81- - shadow
82- importas :
83- no-unaliased : true
84- revive :
85- # By default, revive will enable only the linting rules that are named in the configuration file.
86- # So, it's needed to explicitly enable all required rules here.
43+ settings :
44+ govet :
45+ disable :
46+ - fieldalignment
47+ - shadow
48+ enable-all : true
49+ importas :
50+ no-unaliased : true
51+ revive :
52+ # By default, revive will enable only the linting rules that are named in the configuration file.
53+ # So, it's needed to explicitly enable all required rules here.
54+ rules :
55+ # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
56+ - name : blank-imports
57+ - name : context-as-argument
58+ - name : context-keys-type
59+ - name : dot-imports
60+ - name : error-return
61+ - name : error-strings
62+ - name : error-naming
63+ - name : if-return
64+ - name : increment-decrement
65+ - name : var-naming
66+ - name : var-declaration
67+ - name : range
68+ - name : receiver-naming
69+ - name : time-naming
70+ - name : unexported-return
71+ - name : indent-error-flow
72+ - name : errorf
73+ - name : superfluous-else
74+ - name : unreachable-code
75+ - name : redefines-builtin-id
76+ #
77+ # Rules in addition to the recommended configuration above.
78+ #
79+ - name : bool-literal-in-expr
80+ - name : constant-logical-expr
81+ exclusions :
82+ generated : strict
83+ paths :
84+ - zz_generated.*\.go$
85+ - .*conversion.*\.go$
86+ presets :
87+ - comments
88+ - common-false-positives
89+ - legacy
90+ - std-error-handling
8791 rules :
88- # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
89- - name : blank-imports
90- - name : context-as-argument
91- - name : context-keys-type
92- - name : dot-imports
93- - name : error-return
94- - name : error-strings
95- - name : error-naming
96- - name : if-return
97- - name : increment-decrement
98- - name : var-naming
99- - name : var-declaration
100- - name : range
101- - name : receiver-naming
102- - name : time-naming
103- - name : unexported-return
104- - name : indent-error-flow
105- - name : errorf
106- - name : superfluous-else
107- - name : unreachable-code
108- - name : redefines-builtin-id
109- #
110- # Rules in addition to the recommended configuration above.
111- #
112- - name : bool-literal-in-expr
113- - name : constant-logical-expr
92+ # Dot imports for gomega and ginkgo are allowed
93+ # within test files.
94+ - linters :
95+ - revive
96+ path : _test\.go
97+ text : should not use dot imports
98+ # Ignore error type switch case
99+ - linters :
100+ - errorlint
101+ path : pkg/loader/loader.go
102+ # Ignore test files
103+ - linters :
104+ - dupl
105+ - ginkgolinter
106+ path : _test\.go
107+ - linters :
108+ - gocritic
109+ path : pkg/markers/help.go
110+ - linters :
111+ - exhaustive
112+ path : pkg/markers/parse.go|pkg/deepcopy/traverse.go|pkg/genall/help/types.go|pkg/crd/schema.go|pkg/crd/flatten.go
113+ # Ignore consider pre-allocating variables
114+ - linters :
115+ - prealloc
116+ text : Consider pre-allocating
117+ - linters :
118+ - staticcheck
119+ path : (.+)\.go$
120+ text : (QF1008)
121+ formatters :
122+ enable :
123+ - gofmt
124+ - goimports
125+ exclusions :
126+ generated : strict
127+ paths :
128+ - zz_generated.*\.go$
129+ - .*conversion.*\.go$
0 commit comments