@@ -10,12 +10,13 @@ linters:
1010 # Specifically enable linters we want to use.
1111 enable :
1212 - deadcode
13+ - depguard
1314 - errcheck
15+ - godot
1416 - gofmt
1517 - goimports
1618 - gosimple
1719 - govet
18- - godot
1920 - ineffassign
2021 - misspell
2122 - revive
@@ -25,30 +26,221 @@ linters:
2526 - unused
2627 - varcheck
2728
28-
2929issues :
30+ # Maximum issues count per one linter.
31+ # Set to 0 to disable.
32+ # Default: 50
33+ # Setting to unlimited so the linter only is run once to debug all issues.
34+ max-issues-per-linter : 0
35+ # Maximum count of issues with the same text.
36+ # Set to 0 to disable.
37+ # Default: 3
38+ # Setting to unlimited so the linter only is run once to debug all issues.
39+ max-same-issues : 0
40+ # Excluding configuration per-path, per-linter, per-text and per-source.
3041 exclude-rules :
31- # helpers in tests often (rightfully) pass a *testing.T as their first argument
32- - path : _test\.go
33- text : " context.Context should be the first parameter of a function"
42+ # TODO: Having appropriate comments for exported objects helps development,
43+ # even for objects in internal packages. Appropriate comments for all
44+ # exported objects should be added and this exclusion removed.
45+ - path : ' .*internal/.*'
46+ text : " exported (method|function|type|const) (.+) should have comment or be unexported"
3447 linters :
3548 - revive
36- # Yes, they are, but it's okay in a test
49+ # Yes, they are, but it's okay in a test.
3750 - path : _test\.go
3851 text : " exported func.*returns unexported type.*which can be annoying to use"
3952 linters :
4053 - revive
54+ # Example test functions should be treated like main.
55+ - path : example.*_test\.go
56+ text : " calls to (.+) only in main[(][)] or init[(][)] functions"
57+ linters :
58+ - revive
59+ include :
60+ # revive exported should have comment or be unexported.
61+ - EXC0012
62+ # revive package comment should be of the form ...
63+ - EXC0013
4164
4265linters-settings :
43- misspell :
44- locale : US
45- ignore-words :
46- - cancelled
47- goimports :
48- local-prefixes : go.opentelemetry.io
66+ depguard :
67+ # Check the list against standard lib.
68+ # Default: false
69+ include-go-root : true
70+ # A list of packages for the list type specified.
71+ # Default: []
72+ packages :
73+ - " crypto/md5"
74+ - " crypto/sha1"
75+ - " crypto/**/pkix"
76+ ignore-file-rules :
77+ - " **/*_test.go"
78+ additional-guards :
79+ # Do not allow testing packages in non-test files.
80+ - list-type : denylist
81+ include-go-root : true
82+ packages :
83+ - testing
84+ - github.com/stretchr/testify
85+ ignore-file-rules :
86+ - " **/*_test.go"
87+ - " **/*test/*.go"
88+ - " **/internal/matchers/*.go"
4989 godot :
5090 exclude :
5191 # Exclude sentence fragments for lists.
5292 - ' ^[ ]*[-•]'
5393 # Exclude sentences prefixing a list.
5494 - ' :$'
95+ goimports :
96+ local-prefixes : go.opentelemetry.io
97+ misspell :
98+ locale : US
99+ ignore-words :
100+ - cancelled
101+ revive :
102+ # Sets the default failure confidence.
103+ # This means that linting errors with less than 0.8 confidence will be ignored.
104+ # Default: 0.8
105+ confidence : 0.01
106+ rules :
107+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports
108+ - name : blank-imports
109+ disabled : false
110+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
111+ - name : bool-literal-in-expr
112+ disabled : false
113+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr
114+ - name : constant-logical-expr
115+ disabled : false
116+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument
117+ - name : context-as-argument
118+ disabled : false
119+ arguments :
120+ allowTypesBefore : " *testing.T"
121+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type
122+ - name : context-keys-type
123+ disabled : false
124+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#deep-exit
125+ - name : deep-exit
126+ disabled : false
127+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#defer
128+ - name : defer
129+ disabled : false
130+ arguments :
131+ - ["call-chain", "loop"]
132+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports
133+ - name : dot-imports
134+ disabled : false
135+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports
136+ - name : duplicated-imports
137+ disabled : false
138+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return
139+ - name : early-return
140+ disabled : false
141+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block
142+ - name : empty-block
143+ disabled : false
144+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines
145+ - name : empty-lines
146+ disabled : false
147+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming
148+ - name : error-naming
149+ disabled : false
150+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-return
151+ - name : error-return
152+ disabled : false
153+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-strings
154+ - name : error-strings
155+ disabled : false
156+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#errorf
157+ - name : errorf
158+ disabled : false
159+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported
160+ - name : exported
161+ disabled : false
162+ arguments :
163+ - " sayRepetitiveInsteadOfStutters"
164+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter
165+ - name : flag-parameter
166+ disabled : false
167+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#identical-branches
168+ - name : identical-branches
169+ disabled : false
170+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return
171+ - name : if-return
172+ disabled : false
173+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement
174+ - name : increment-decrement
175+ disabled : false
176+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow
177+ - name : indent-error-flow
178+ disabled : false
179+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing
180+ - name : import-shadowing
181+ disabled : false
182+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#package-comments
183+ - name : package-comments
184+ disabled : false
185+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range
186+ - name : range
187+ disabled : false
188+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure
189+ - name : range-val-in-closure
190+ disabled : false
191+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-address
192+ - name : range-val-address
193+ disabled : false
194+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id
195+ - name : redefines-builtin-id
196+ disabled : false
197+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format
198+ - name : string-format
199+ disabled : false
200+ arguments :
201+ - - panic
202+ - ' /^[^\n]*$/'
203+ - must not contain line breaks
204+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag
205+ - name : struct-tag
206+ disabled : false
207+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else
208+ - name : superfluous-else
209+ disabled : false
210+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-equal
211+ - name : time-equal
212+ disabled : false
213+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming
214+ - name : var-naming
215+ disabled : false
216+ arguments :
217+ - ["ID"] # AllowList
218+ - ["Otel", "Aws", "Gcp"] # DenyList
219+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration
220+ - name : var-declaration
221+ disabled : false
222+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unconditional-recursion
223+ - name : unconditional-recursion
224+ disabled : false
225+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return
226+ - name : unexported-return
227+ disabled : false
228+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error
229+ - name : unhandled-error
230+ disabled : false
231+ arguments :
232+ - " fmt.Fprint"
233+ - " fmt.Fprintf"
234+ - " fmt.Fprintln"
235+ - " fmt.Print"
236+ - " fmt.Printf"
237+ - " fmt.Println"
238+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt
239+ - name : unnecessary-stmt
240+ disabled : false
241+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
242+ - name : useless-break
243+ disabled : false
244+ # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value
245+ - name : waitgroup-by-value
246+ disabled : false
0 commit comments