Skip to content

Commit 820510e

Browse files
authored
[chore] [all] Enable exhaustive linter on golangci-lint (open-telemetry#23242)
Enable exhaustive linter on golangci-lint Signed-off-by: Ziqi Zhao <[email protected]>
1 parent 752330e commit 820510e

File tree

2 files changed

+219
-1
lines changed

2 files changed

+219
-1
lines changed

.golangci.yml

+218
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ linters:
129129
- errcheck
130130
- errorlint
131131
- exportloopref
132+
- exhaustive
132133
- gci
133134
- gocritic
134135
- gofmt
@@ -153,3 +154,220 @@ issues:
153154
- text: "G402:"
154155
linters:
155156
- gosec
157+
# Following exclude-rules are used to exclude the existing components which do not pass exhaustive lint,
158+
# in order to enable the exhaustive lint check.
159+
# We should not add more exclude-rules.
160+
# The progress of solving existing exclude-rules will be tracked in https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23266
161+
- path: awscontainerinsightreceiver
162+
linters:
163+
- exhaustive
164+
- path: azureeventhubreceiver
165+
linters:
166+
- exhaustive
167+
- path: filereceiver
168+
linters:
169+
- exhaustive
170+
- path: fluentforwardreceiver
171+
linters:
172+
- exhaustive
173+
- path: googlecloudpubsubreceiver
174+
linters:
175+
- exhaustive
176+
- path: googlecloudspannerreceiver
177+
linters:
178+
- exhaustive
179+
- path: k8sclusterreceiver
180+
linters:
181+
- exhaustive
182+
- path: kubeletstatsreceiver
183+
linters:
184+
- exhaustive
185+
- path: nsxtreceiver
186+
linters:
187+
- exhaustive
188+
- path: podmanreceiver
189+
linters:
190+
- exhaustive
191+
- path: prometheusreceiver
192+
linters:
193+
- exhaustive
194+
- path: receivercreator
195+
linters:
196+
- exhaustive
197+
- path: snmpreceiver
198+
linters:
199+
- exhaustive
200+
- path: statsdreceiver
201+
linters:
202+
- exhaustive
203+
- path: attributesprocessor
204+
linters:
205+
- exhaustive
206+
- path: cumulativetodeltaprocessor
207+
linters:
208+
- exhaustive
209+
- path: deltatorateprocessor
210+
linters:
211+
- exhaustive
212+
- path: groupbyattrsprocessor
213+
linters:
214+
- exhaustive
215+
- path: filterprocessor
216+
linters:
217+
- exhaustive
218+
- path: metricsgenerationprocessor
219+
linters:
220+
- exhaustive
221+
- path: metricstransformprocessor
222+
linters:
223+
- exhaustive
224+
- path: probabilisticsamplerprocessor
225+
linters:
226+
- exhaustive
227+
- path: servicegraphprocessor
228+
linters:
229+
- exhaustive
230+
- path: spanprocessor
231+
linters:
232+
- exhaustive
233+
- path: resourcedetectionprocessor
234+
linters:
235+
- exhaustive
236+
- path: tailsamplingprocessor
237+
linters:
238+
- exhaustive
239+
- path: transformprocessor
240+
linters:
241+
- exhaustive
242+
- path: alibabacloudlogserviceexporter
243+
linters:
244+
- exhaustive
245+
- path: awsemfexporter
246+
linters:
247+
- exhaustive
248+
- path: awsxrayexporter
249+
linters:
250+
- exhaustive
251+
- path: azuremonitorexporter
252+
linters:
253+
- exhaustive
254+
- path: azuredataexplorerexporter
255+
linters:
256+
- exhaustive
257+
- path: carbonexporter
258+
linters:
259+
- exhaustive
260+
- path: coralogixexporter
261+
linters:
262+
- exhaustive
263+
- path: clickhouseexporter
264+
linters:
265+
- exhaustive
266+
- path: datasetexporter
267+
linters:
268+
- exhaustive
269+
- path: dynatraceexporter
270+
linters:
271+
- exhaustive
272+
- path: elasticsearchexporter
273+
linters:
274+
- exhaustive
275+
- path: datadogexporter
276+
linters:
277+
- exhaustive
278+
- path: googlecloudpubsubexporter
279+
linters:
280+
- exhaustive
281+
- path: instanaexporter
282+
linters:
283+
- exhaustive
284+
- path: jaegerthrifthttpexporter
285+
linters:
286+
- exhaustive
287+
- path: logzioexporter
288+
linters:
289+
- exhaustive
290+
- path: sentryexporter
291+
linters:
292+
- exhaustive
293+
- path: prometheusexporter
294+
linters:
295+
- exhaustive
296+
- path: prometheusremotewriteexporter
297+
linters:
298+
- exhaustive
299+
- path: sumologicexporter
300+
linters:
301+
- exhaustive
302+
- path: skywalkingexporter
303+
linters:
304+
- exhaustive
305+
- path: splunkhecexporter
306+
linters:
307+
- exhaustive
308+
- path: signalfxexporter
309+
linters:
310+
- exhaustive
311+
- path: tanzuobservabilityexporter
312+
linters:
313+
- exhaustive
314+
- path: k8sobserver
315+
linters:
316+
- exhaustive
317+
- path: countconnector
318+
linters:
319+
- exhaustive
320+
- path: storage
321+
linters:
322+
- exhaustive
323+
- path: containerinsight
324+
linters:
325+
- exhaustive
326+
- path: filter
327+
linters:
328+
- exhaustive
329+
- path: coreinternal
330+
linters:
331+
- exhaustive
332+
- path: k8sconfig
333+
linters:
334+
- exhaustive
335+
- path: pdatatest
336+
linters:
337+
- exhaustive
338+
- path: ottl
339+
linters:
340+
- exhaustive
341+
- path: stanza
342+
linters:
343+
- exhaustive
344+
- path: resourcetotelemetry
345+
linters:
346+
- exhaustive
347+
- path: jaeger
348+
linters:
349+
- exhaustive
350+
- path: prometheus
351+
linters:
352+
- exhaustive
353+
- path: loki
354+
linters:
355+
- exhaustive
356+
- path: opencensus
357+
linters:
358+
- exhaustive
359+
- path: signalfx
360+
linters:
361+
- exhaustive
362+
- path: zipkin
363+
linters:
364+
- exhaustive
365+
- path: mdatagen
366+
linters:
367+
- exhaustive
368+
- path: configschema
369+
linters:
370+
- exhaustive
371+
- path: testbed
372+
linters:
373+
- exhaustive

Makefile.Common

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fmt: $(GOIMPORTS)
155155

156156
.PHONY: lint
157157
lint: $(LINT) checklicense misspell
158-
$(LINT) run --allow-parallel-runners --build-tags integration
158+
$(LINT) run --allow-parallel-runners --build-tags integration --path-prefix $(shell basename "$(CURDIR)")
159159

160160
.PHONY: govulncheck
161161
govulncheck: $(GOVULNCHECK)

0 commit comments

Comments
 (0)