traefik/.golangci.toml

108 lines
3.5 KiB
TOML
Raw Normal View History

2018-11-14 09:18:03 +00:00
[run]
2019-10-09 17:12:05 +00:00
timeout = "10m"
2019-04-01 13:30:07 +00:00
skip-files = []
skip-dirs = [
"pkg/provider/kubernetes/crd/generated/",
]
2018-11-14 09:18:03 +00:00
2018-08-06 18:00:03 +00:00
[linters-settings]
[linters-settings.govet]
2019-03-04 15:40:05 +00:00
check-shadowing = false
2018-08-06 18:00:03 +00:00
[linters-settings.golint]
min-confidence = 0.0
[linters-settings.gocyclo]
2019-03-04 15:40:05 +00:00
min-complexity = 14.0
2018-08-06 18:00:03 +00:00
[linters-settings.maligned]
suggest-new = true
[linters-settings.goconst]
2018-11-14 09:18:03 +00:00
min-len = 3.0
2019-02-05 16:10:03 +00:00
min-occurrences = 4.0
2018-08-06 18:00:03 +00:00
[linters-settings.misspell]
locale = "US"
2019-09-10 15:52:04 +00:00
[linters-settings.funlen]
lines = 230 # default 60
statements = 120 # default 40
2018-08-06 18:00:03 +00:00
[linters]
enable-all = true
disable = [
2019-03-04 15:40:05 +00:00
"gocyclo", # FIXME must be fixed
"gosec",
"dupl",
2018-11-14 09:18:03 +00:00
"maligned",
"lll",
2019-03-04 15:40:05 +00:00
"unparam",
2018-11-14 09:18:03 +00:00
"prealloc",
2019-03-04 15:40:05 +00:00
"scopelint",
2019-02-05 16:10:03 +00:00
"gochecknoinits",
"gochecknoglobals",
"godox",
"gocognit",
2019-07-12 13:04:03 +00:00
"bodyclose", # Too many false-positive and panics.
"wsl", # Too strict
2020-01-19 22:00:06 +00:00
"gomnd", # Too strict
"stylecheck", # skip because report issues related to some generated files.
2018-11-14 09:18:03 +00:00
]
[issues]
2019-03-04 15:40:05 +00:00
exclude-use-default = false
2018-11-14 09:18:03 +00:00
max-per-linter = 0
2019-03-04 15:40:05 +00:00
max-same-issues = 0
2018-11-14 09:18:03 +00:00
exclude = [
2019-03-04 15:40:05 +00:00
"SA1019: http.CloseNotifier is deprecated: the CloseNotifier interface predates Go's context package. New code should use Request.Context instead.", # FIXME must be fixed
"Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*printf?|os\\.(Un)?Setenv). is not checked",
"should have a package comment, unless it's in another file for this package",
2018-11-14 09:18:03 +00:00
]
2019-03-04 15:40:05 +00:00
[[issues.exclude-rules]]
2019-09-10 15:52:04 +00:00
path = "(.+)_test.go"
linters = ["goconst", "funlen"]
2019-03-04 15:40:05 +00:00
[[issues.exclude-rules]]
path = "integration/.+_test.go"
text = "Error return value of `cmd\\.Process\\.Kill` is not checked"
[[issues.exclude-rules]]
path = "integration/(consul_catalog_test|constraint_test).go"
text = "Error return value of `(s.deregisterService|s.deregisterAgentService)` is not checked"
[[issues.exclude-rules]]
path = "integration/grpc_test.go"
text = "Error return value of `closer` is not checked"
[[issues.exclude-rules]]
2019-04-01 13:30:07 +00:00
path = "pkg/h2c/h2c.go"
text = "Error return value of `rw.Write` is not checked"
[[issues.exclude-rules]]
path = "pkg/middlewares/recovery/recovery.go"
text = "`logger` can be `github.com/stretchr/testify/assert.TestingT`"
2019-03-04 15:40:05 +00:00
[[issues.exclude-rules]]
2019-04-01 13:30:07 +00:00
path = "pkg/provider/docker/builder_test.go"
2019-03-04 15:40:05 +00:00
text = "(U1000: func )?`(.+)` is unused"
[[issues.exclude-rules]]
2019-04-01 13:30:07 +00:00
path = "pkg/provider/kubernetes/builder_(endpoint|service)_test.go"
text = "(U1000: func )?`(.+)` is unused"
2019-03-04 15:40:05 +00:00
[[issues.exclude-rules]]
path = "pkg/config/parser/.+_test.go"
2019-04-01 13:30:07 +00:00
text = "U1000: field `(foo|fuu)` is unused"
2019-03-04 15:40:05 +00:00
[[issues.exclude-rules]]
2019-04-01 13:30:07 +00:00
path = "pkg/server/service/bufferpool.go"
2019-03-04 15:40:05 +00:00
text = "SA6002: argument should be pointer-like to avoid allocations"
2019-04-01 13:30:07 +00:00
[[issues.exclude-rules]]
path = "cmd/configuration.go"
text = "string `traefik` has (\\d) occurrences, make it a constant"
[[issues.exclude-rules]]
path = "pkg/server/middleware/middlewares.go"
text = "Function 'buildConstructor' is too long \\(\\d+ > 230\\)"
2019-03-04 15:40:05 +00:00
[[issues.exclude-rules]] # FIXME must be fixed
path = "cmd/context.go"
text = "S1000: should use a simple channel send/receive instead of `select` with a single case"
2020-01-19 22:00:06 +00:00
[[issues.exclude-rules]]
path = "pkg/tracing/haystack/logger.go"
linters = ["goprintffuncname"]
[[issues.exclude-rules]]
path = "pkg/tracing/tracing.go"
text = "printf-like formatting function 'SetErrorWithEvent' should be named 'SetErrorWithEventf'"