2021-03-24 13:49:55 +01:00
|
|
|
linters-settings:
|
2022-05-24 19:05:11 +02:00
|
|
|
depguard:
|
|
|
|
list-type: blacklist
|
|
|
|
packages:
|
|
|
|
# logging is allowed only by logutils.Log, logrus
|
|
|
|
# is allowed to use only in logutils package
|
|
|
|
- github.com/sirupsen/logrus
|
|
|
|
packages-with-error-message:
|
|
|
|
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
|
|
|
|
dupl:
|
|
|
|
threshold: 100
|
|
|
|
funlen:
|
|
|
|
lines: 100
|
|
|
|
statements: 50
|
|
|
|
gci:
|
|
|
|
local-prefixes: github.com/golangci/golangci-lint
|
|
|
|
goconst:
|
|
|
|
min-len: 2
|
|
|
|
min-occurrences: 2
|
|
|
|
gocritic:
|
|
|
|
enabled-tags:
|
|
|
|
- diagnostic
|
|
|
|
- experimental
|
|
|
|
- opinionated
|
|
|
|
- performance
|
|
|
|
- style
|
|
|
|
disabled-checks:
|
|
|
|
- dupImport # https://github.com/go-critic/go-critic/issues/845
|
|
|
|
- ifElseChain
|
|
|
|
- octalLiteral
|
|
|
|
- whyNoLint
|
|
|
|
- wrapperFunc
|
|
|
|
gocyclo:
|
|
|
|
min-complexity: 15
|
|
|
|
goimports:
|
|
|
|
local-prefixes: github.com/golangci/golangci-lint
|
|
|
|
gomnd:
|
|
|
|
settings:
|
|
|
|
mnd:
|
|
|
|
# don't include the "operation" and "assign"
|
|
|
|
checks:
|
|
|
|
- argument
|
|
|
|
- case
|
|
|
|
- condition
|
|
|
|
- return
|
2021-03-24 13:49:55 +01:00
|
|
|
govet:
|
2022-05-24 19:05:11 +02:00
|
|
|
check-shadowing: true
|
|
|
|
settings:
|
|
|
|
printf:
|
|
|
|
funcs:
|
|
|
|
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
|
|
|
|
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
|
|
|
|
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
|
|
|
|
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
|
|
|
|
lll:
|
|
|
|
line-length: 140
|
|
|
|
maligned:
|
|
|
|
suggest-new: true
|
|
|
|
misspell:
|
|
|
|
locale: US
|
|
|
|
nolintlint:
|
|
|
|
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
|
|
|
|
allow-unused: false # report any unused nolint directives
|
|
|
|
require-explanation: false # don't require an explanation for nolint directives
|
|
|
|
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
|
2021-03-24 13:49:55 +01:00
|
|
|
|
|
|
|
linters:
|
2022-05-24 19:05:11 +02:00
|
|
|
disable-all: true
|
|
|
|
enable:
|
|
|
|
- asciicheck
|
|
|
|
- bodyclose
|
|
|
|
# - deadcode
|
|
|
|
- depguard
|
|
|
|
# - dogsled
|
|
|
|
# - dupl
|
|
|
|
# - errcheck
|
|
|
|
# - exhaustive
|
|
|
|
- exportloopref
|
|
|
|
# - funlen
|
|
|
|
# - gochecknoglobals
|
|
|
|
# - gochecknoinits
|
|
|
|
# - gocognit
|
|
|
|
# - goconst
|
|
|
|
# - gocritic
|
|
|
|
# - gocyclo
|
|
|
|
# - godot
|
|
|
|
# - godox
|
|
|
|
# - goerr113
|
|
|
|
- gofmt
|
|
|
|
- goimports
|
|
|
|
# - gomnd
|
|
|
|
- goprintffuncname
|
|
|
|
# - gosec
|
|
|
|
# - gosimple
|
|
|
|
# - govet
|
|
|
|
# - ineffassign
|
|
|
|
# - interfacer
|
|
|
|
# - lll
|
|
|
|
# - maligned
|
|
|
|
# - misspell
|
|
|
|
- nakedret
|
|
|
|
# - nestif
|
|
|
|
# - noctx
|
|
|
|
# - nolintlint
|
|
|
|
# - prealloc
|
2022-08-05 06:17:00 +02:00
|
|
|
# - rowserrcheck # Disabled due to generic, see https://github.com/golangci/golangci-lint/issues/2649
|
2022-05-24 19:05:11 +02:00
|
|
|
# - revive
|
|
|
|
# - scopelint
|
|
|
|
# - staticcheck
|
|
|
|
# - structcheck
|
|
|
|
# - stylecheck
|
|
|
|
# - testpackage
|
|
|
|
# - typecheck
|
|
|
|
- unconvert
|
|
|
|
# - unparam
|
|
|
|
# - unused
|
|
|
|
# - varcheck
|
|
|
|
# - whitespace
|
|
|
|
# - wsl
|
2021-03-24 13:49:55 +01:00
|
|
|
|
|
|
|
issues:
|
2022-05-24 19:05:11 +02:00
|
|
|
# Excluding configuration per-path, per-linter, per-text and per-source
|
2021-03-24 13:49:55 +01:00
|
|
|
exclude-rules:
|
|
|
|
- path: _test\.go
|
|
|
|
linters:
|
2022-05-24 19:05:11 +02:00
|
|
|
- gomnd
|
|
|
|
|
|
|
|
- path: pkg/golinters/errcheck.go
|
|
|
|
text: "SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead"
|
|
|
|
- path: pkg/commands/run.go
|
|
|
|
text: "SA1019: lsc.Errcheck.Exclude is deprecated: use ExcludeFunctions instead"
|
|
|
|
|
|
|
|
# TODO must be removed after the release of the next version (v1.41.0)
|
|
|
|
- path: pkg/commands/run.go
|
|
|
|
linters:
|
|
|
|
- gomnd
|
|
|
|
# TODO must be removed after the release of the next version (v1.41.0)
|
|
|
|
- path: pkg/golinters/nolintlint/nolintlint.go
|
|
|
|
linters:
|
|
|
|
- gomnd
|
|
|
|
# TODO must be removed after the release of the next version (v1.41.0)
|
|
|
|
- path: pkg/printers/tab.go
|
|
|
|
linters:
|
|
|
|
- gomnd
|
|
|
|
|
|
|
|
|
|
|
|
run:
|
|
|
|
skip-dirs:
|
|
|
|
- test/testdata_etc
|
|
|
|
- internal/cache
|
|
|
|
- internal/renameio
|
|
|
|
- internal/robustio
|