1+ version : " 2"
12run :
2- timeout : 10m
33 allow-parallel-runners : true
4-
54linters :
6- disable-all : true
5+ default : none
76 enable :
8- - asasalint
9- - asciicheck
10- - bidichk
11- - bodyclose
12- - containedctx
13- - copyloopvar
14- - dupword
15- - durationcheck
16- - errcheck
17- - errchkjson
18- - gci
19- - gocritic
20- - godot
21- - gofmt
22- - goprintffuncname
23- - gosec
24- - gosimple
25- - govet
26- - importas
27- - ineffassign
28- - misspell
29- - nilerr
30- - noctx
31- - nolintlint
32- - nosprintfhostport
33- - prealloc
34- - revive
35- - staticcheck
36- - unconvert
37- - unused
38- - usestdlibvars
39- - whitespace
7+ - asasalint
8+ - asciicheck
9+ - bidichk
10+ - bodyclose
11+ - containedctx
12+ - copyloopvar
13+ - dupword
14+ - durationcheck
15+ - errcheck
16+ - errchkjson
17+ - gocritic
18+ - godot
19+ - goprintffuncname
20+ - gosec
21+ - govet
22+ - importas
23+ - ineffassign
24+ - misspell
25+ - nilerr
26+ - noctx
27+ - nolintlint
28+ - nosprintfhostport
29+ - prealloc
30+ - revive
31+ - staticcheck
32+ - unconvert
33+ - unused
34+ - usestdlibvars
35+ - whitespace
4036 # TODO(vincepri): Figure out if we want to enable or remove the following linters:
4137 # - predeclared
4238 # - goconst
43-
44- linters-settings :
45- misspell :
46- ignore-words :
47- - creater
48- goconst :
49- ignore-tests : true
50- nolintlint :
51- allow-unused : false
52- allow-leading-space : false
53- require-specific : true
54- revive :
39+ settings :
40+ gocritic :
41+ disabled-checks :
42+ - appendAssign
43+ - dupImport # https://github.com/go-critic/go-critic/issues/845
44+ - evalOrder
45+ - ifElseChain
46+ - octalLiteral
47+ - regexpSimplify
48+ - sloppyReassign
49+ - truncateCmp
50+ - typeDefFirst
51+ - unnamedResult
52+ - unnecessaryDefer
53+ - whyNoLint
54+ - wrapperFunc
55+ - unnecessaryBlock
56+ - rangeValCopy
57+ - hugeParam
58+ - commentedOutCode
59+ - emptyStringTest
60+ - singleCaseSwitch
61+ - nestingReduce
62+ - filepathJoin
63+ - tooManyResultsChecker
64+ enabled-tags :
65+ - diagnostic
66+ - experimental
67+ - performance
68+ gosec :
69+ excludes :
70+ - G307 # Deferring unsafe method "Close" on type "\*os.File"
71+ - G108 # Profiling endpoint is automatically exposed on /debug/pprof
72+ # TODO(vincepri): The following should be looked at and removed in future iterations.
73+ - G401 # Use of weak cryptographic primitive (replace sha1 usage)
74+ - G505 # crypto/sha1: weak cryptographic primitive
75+ - G402 # TLS MinVersion too low (set MinVersion in TLSClientConfig)
76+ - G404 # Use of weak random number generator (use crypto/rand)
77+ - G101 # Potential hardcoded credentials (returns false positives)
78+ - G306 # Expect WriteFile permissions to be 0600 or less
79+ misspell :
80+ ignore-rules :
81+ - creater
82+ nolintlint :
83+ require-specific : true
84+ allow-unused : false
85+ revive :
5586 # make sure error-strings issues actually surface (default confidence is 0.8)
56- confidence : 0.6
57- rules :
58- - name : context-keys-type
59- - name : duplicated-imports
60- - name : error-return
61- - name : error-strings
62- - name : error-naming
63- - name : if-return
64- - name : increment-decrement
65- - name : var-declaration
66- - name : package-comments
67- - name : range
68- - name : receiver-naming
69- - name : time-naming
70- - name : errorf
71- - name : superfluous-else
72- - name : unreachable-code
73- - name : bool-literal-in-expr
74- - name : constant-logical-expr
87+ confidence : 0.6
88+ rules :
89+ - name : context-keys-type
90+ - name : duplicated-imports
91+ - name : error-return
92+ - name : error-strings
93+ - name : error-naming
94+ - name : if-return
95+ - name : increment-decrement
96+ - name : var-declaration
97+ - name : package-comments
98+ - name : range
99+ - name : receiver-naming
100+ - name : time-naming
101+ - name : errorf
102+ - name : superfluous-else
103+ - name : unreachable-code
104+ - name : bool-literal-in-expr
105+ - name : constant-logical-expr
75106 # TODO(vincepri): Figure out if we want to enable
76107 # the following rules, or remove them completely, they're a bit noisy.
77108 # - name: context-as-argument
@@ -82,69 +113,55 @@ linters-settings:
82113 # - name: indent-error-flow # I think @ncdc prefers explicit else statements, remove?
83114 # - name: redefines-builtin-id
84115 # - name: dot-imports
85- gci :
86- custom-order : true
87- sections :
88- - standard
89- - default
90- - prefix(k8s.io)
91- - prefix(github.com/kcp-dev)
92- - prefix(github.com/kcp-dev/kcp)
93- - blank
94- - dot
95- skip-generated : false
96- gosec :
97- excludes :
98- - G307 # Deferring unsafe method "Close" on type "\*os.File"
99- - G108 # Profiling endpoint is automatically exposed on /debug/pprof
100- # TODO(vincepri): The following should be looked at and removed in future iterations.
101- - G401 # Use of weak cryptographic primitive (replace sha1 usage)
102- - G505 # crypto/sha1: weak cryptographic primitive
103- - G402 # TLS MinVersion too low (set MinVersion in TLSClientConfig)
104- - G404 # Use of weak random number generator (use crypto/rand)
105- - G101 # Potential hardcoded credentials (returns false positives)
106- - G306 # Expect WriteFile permissions to be 0600 or less
107- gocritic :
108- enabled-tags :
109- - diagnostic
110- - experimental
111- - performance
112- disabled-checks :
113- - appendAssign
114- - dupImport # https://github.com/go-critic/go-critic/issues/845
115- - evalOrder
116- - ifElseChain
117- - octalLiteral
118- - regexpSimplify
119- - sloppyReassign
120- - truncateCmp
121- - typeDefFirst
122- - unnamedResult
123- - unnecessaryDefer
124- - whyNoLint
125- - wrapperFunc
126- - unnecessaryBlock
127- - rangeValCopy
128- - hugeParam
129- - commentedOutCode
130- # TODO(vincepri): potentially enable the following?
131- - emptyStringTest
132- - singleCaseSwitch
133- - nestingReduce
134- - filepathJoin
135- - tooManyResultsChecker
136-
116+ exclusions :
117+ generated : lax
118+ presets :
119+ - comments
120+ - common-false-positives
121+ - legacy
122+ - std-error-handling
123+ rules :
124+ - linters :
125+ - unparam
126+ text : always receives
127+ - linters :
128+ - gosec
129+ path : _test\.go
130+ text : ' G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server'
131+ - linters :
132+ - gosec
133+ path : test/e2e/*
134+ - linters :
135+ - goconst
136+ path : (.+)_test\.go
137+ - linters :
138+ - staticcheck
139+ text : QF1008
140+ paths :
141+ - third_party$
142+ - builtin$
143+ - examples$
137144issues :
138- max-same-issues : 0
139145 max-issues-per-linter : 0
140- exclude-rules :
141- - linters :
142- - unparam
143- text : always receives
144- - linters :
145- - gosec
146- path : _test\.go
147- text : " G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server"
148- - linters :
149- - gosec
150- path : test/e2e/*
146+ max-same-issues : 0
147+ formatters :
148+ enable :
149+ - gci
150+ - gofmt
151+ settings :
152+ gci :
153+ sections :
154+ - standard
155+ - default
156+ - prefix(k8s.io)
157+ - prefix(github.com/kcp-dev)
158+ - prefix(github.com/kcp-dev/kcp)
159+ - blank
160+ - dot
161+ custom-order : true
162+ exclusions :
163+ generated : disable
164+ paths :
165+ - third_party$
166+ - builtin$
167+ - examples$
0 commit comments