2019-06-19 02:09:49 +02:00
|
|
|
# See https://github.com/golangci/golangci-lint#config-file
|
|
|
|
run:
|
|
|
|
issues-exit-code: 1 #Default
|
2019-08-05 22:58:24 +02:00
|
|
|
tests: true #Default
|
|
|
|
|
|
|
|
linters:
|
2022-02-14 19:09:41 +02:00
|
|
|
# Disable everything by default so upgrades to not include new "default
|
|
|
|
# enabled" linters.
|
|
|
|
disable-all: true
|
|
|
|
# Specifically enable linters we want to use.
|
2019-08-05 22:58:24 +02:00
|
|
|
enable:
|
2022-02-14 19:09:41 +02:00
|
|
|
- deadcode
|
|
|
|
- errcheck
|
|
|
|
- gofmt
|
2019-08-05 22:58:24 +02:00
|
|
|
- goimports
|
2022-02-14 19:09:41 +02:00
|
|
|
- gosimple
|
|
|
|
- govet
|
|
|
|
- ineffassign
|
|
|
|
- misspell
|
2021-06-08 19:10:01 +02:00
|
|
|
- revive
|
2022-02-14 19:09:41 +02:00
|
|
|
- staticcheck
|
|
|
|
- structcheck
|
|
|
|
- typecheck
|
|
|
|
- unused
|
|
|
|
- varcheck
|
|
|
|
|
2019-10-16 19:24:38 +02:00
|
|
|
|
|
|
|
issues:
|
|
|
|
exclude-rules:
|
|
|
|
# helpers in tests often (rightfully) pass a *testing.T as their first argument
|
|
|
|
- path: _test\.go
|
|
|
|
text: "context.Context should be the first parameter of a function"
|
|
|
|
linters:
|
2021-06-08 19:10:01 +02:00
|
|
|
- revive
|
2019-10-16 19:24:38 +02:00
|
|
|
# Yes, they are, but it's okay in a test
|
|
|
|
- path: _test\.go
|
|
|
|
text: "exported func.*returns unexported type.*which can be annoying to use"
|
|
|
|
linters:
|
2021-06-08 19:10:01 +02:00
|
|
|
- revive
|
2019-08-05 22:58:24 +02:00
|
|
|
|
|
|
|
linters-settings:
|
|
|
|
misspell:
|
|
|
|
locale: US
|
2020-05-29 20:11:19 +02:00
|
|
|
ignore-words:
|
|
|
|
- cancelled
|
2019-08-05 22:58:24 +02:00
|
|
|
goimports:
|
2019-08-26 18:41:15 +02:00
|
|
|
local-prefixes: go.opentelemetry.io
|