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+ modules-download-mode : readonly
5+ allow-parallel-runners : true
96linters :
107 # sync from https://github.com/kubernetes-sigs/controller-runtime/blob/main/.golangci.yml
11- disable-all : true
8+ default : none
129 enable :
1310 - asasalint
1411 - asciicheck
@@ -25,10 +22,7 @@ linters:
2522 - goconst
2623 - gocritic
2724 - gocyclo
28- - gofmt
29- - goimports
3025 - goprintffuncname
31- - gosimple
3226 - govet
3327 - importas
3428 - ineffassign
@@ -40,74 +34,91 @@ linters:
4034 - prealloc
4135 - revive
4236 - staticcheck
43- - stylecheck
4437 - tagliatelle
45- - typecheck
4638 - unconvert
4739 - unparam
4840 - unused
4941 - 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.
42+ settings :
43+ govet :
44+ disable :
45+ - fieldalignment
46+ - shadow
47+ enable-all : true
48+ importas :
49+ no-unaliased : true
50+ revive :
51+ # By default, revive will enable only the linting rules that are named in the configuration file.
52+ # So, it's needed to explicitly enable all required rules here.
53+ rules :
54+ # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
55+ - name : blank-imports
56+ - name : context-as-argument
57+ - name : context-keys-type
58+ - name : dot-imports
59+ - name : error-return
60+ - name : error-strings
61+ - name : error-naming
62+ - name : if-return
63+ - name : increment-decrement
64+ - name : var-naming
65+ - name : var-declaration
66+ - name : range
67+ - name : receiver-naming
68+ - name : time-naming
69+ - name : unexported-return
70+ - name : indent-error-flow
71+ - name : errorf
72+ - name : superfluous-else
73+ - name : unreachable-code
74+ - name : redefines-builtin-id
75+ #
76+ # Rules in addition to the recommended configuration above.
77+ #
78+ - name : bool-literal-in-expr
79+ - name : constant-logical-expr
80+ exclusions :
81+ generated : lax
82+ presets :
83+ - comments
84+ - common-false-positives
85+ - legacy
86+ - std-error-handling
8787 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
88+ # Dot imports for gomega and ginkgo are allowed
89+ # within test files.
90+ - path : _test\.go
91+ text : should not use dot imports
92+ # Ignore error type switch case
93+ - linters :
94+ - errorlint
95+ path : pkg/loader/loader.go
96+ # Ignore test files
97+ - linters :
98+ - dupl
99+ - ginkgolinter
100+ path : _test\.go
101+ - linters :
102+ - gocritic
103+ path : pkg/markers/help.go
104+ - linters :
105+ - exhaustive
106+ path : pkg/markers/parse.go|pkg/deepcopy/traverse.go|pkg/genall/help/types.go|pkg/crd/schema.go|pkg/crd/flatten.go
107+ # Ignore consider pre-allocating variables
108+ - linters :
109+ - prealloc
110+ text : Consider pre-allocating
111+ paths :
112+ - third_party$
113+ - builtin$
114+ - examples$
115+ formatters :
116+ enable :
117+ - gofmt
118+ - goimports
119+ exclusions :
120+ generated : lax
121+ paths :
122+ - third_party$
123+ - builtin$
124+ - examples$
0 commit comments