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 :
10- # sync from https://github.com/kubernetes-sigs/controller-runtime/blob/main/.golangci.yml
11- disable-all : true
7+ default : none
128 enable :
139 - asasalint
1410 - asciicheck
@@ -25,10 +21,7 @@ linters:
2521 - goconst
2622 - gocritic
2723 - gocyclo
28- - gofmt
29- - goimports
3024 - goprintffuncname
31- - gosimple
3225 - govet
3326 - importas
3427 - ineffassign
@@ -40,74 +33,80 @@ linters:
4033 - prealloc
4134 - revive
4235 - staticcheck
43- - stylecheck
4436 - tagliatelle
45- - typecheck
4637 - unconvert
4738 - unparam
4839 - unused
4940 - 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.
41+ settings :
42+ govet :
43+ disable :
44+ - fieldalignment
45+ - shadow
46+ enable-all : true
47+ importas :
48+ no-unaliased : true
49+ revive :
50+ rules :
51+ - name : blank-imports
52+ - name : context-as-argument
53+ - name : context-keys-type
54+ - name : dot-imports
55+ - name : error-return
56+ - name : error-strings
57+ - name : error-naming
58+ - name : if-return
59+ - name : increment-decrement
60+ - name : var-naming
61+ - name : var-declaration
62+ - name : range
63+ - name : receiver-naming
64+ - name : time-naming
65+ - name : unexported-return
66+ - name : indent-error-flow
67+ - name : errorf
68+ - name : superfluous-else
69+ - name : unreachable-code
70+ - name : redefines-builtin-id
71+ - name : bool-literal-in-expr
72+ - name : constant-logical-expr
73+ exclusions :
74+ generated : lax
75+ presets :
76+ - comments
77+ - common-false-positives
78+ - legacy
79+ - std-error-handling
8780 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
81+ - path : _test\.go
82+ text : should not use dot imports
83+ - linters :
84+ - errorlint
85+ path : pkg/loader/loader.go
86+ - linters :
87+ - dupl
88+ - ginkgolinter
89+ path : _test\.go
90+ - linters :
91+ - gocritic
92+ path : pkg/markers/help.go
93+ - linters :
94+ - exhaustive
95+ path : pkg/markers/parse.go|pkg/deepcopy/traverse.go|pkg/genall/help/types.go|pkg/crd/schema.go|pkg/crd/flatten.go
96+ - linters :
97+ - prealloc
98+ text : Consider pre-allocating
99+ paths :
100+ - third_party$
101+ - builtin$
102+ - examples$
103+ formatters :
104+ enable :
105+ - gofmt
106+ - goimports
107+ exclusions :
108+ generated : lax
109+ paths :
110+ - third_party$
111+ - builtin$
112+ - examples$
0 commit comments