2020-01-30 20:50:38 +00:00
|
|
|
linters-settings:
|
2022-09-21 03:57:08 +00: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"
|
2020-01-30 20:50:38 +00:00
|
|
|
dupl:
|
|
|
|
threshold: 100
|
|
|
|
funlen:
|
2022-09-21 03:57:08 +00:00
|
|
|
lines: 100
|
|
|
|
statements: 50
|
|
|
|
gci:
|
|
|
|
local-prefixes: github.com/golangci/golangci-lint
|
2020-01-30 20:50:38 +00:00
|
|
|
goconst:
|
2022-09-21 03:57:08 +00:00
|
|
|
min-len: 2
|
|
|
|
min-occurrences: 2
|
2020-01-30 20:50:38 +00:00
|
|
|
gocritic:
|
|
|
|
enabled-tags:
|
2022-09-21 03:57:08 +00:00
|
|
|
- diagnostic
|
|
|
|
- experimental
|
|
|
|
- opinionated
|
2020-01-30 20:50:38 +00:00
|
|
|
- performance
|
2022-09-21 03:57:08 +00:00
|
|
|
- style
|
|
|
|
disabled-checks:
|
|
|
|
- dupImport # https://github.com/go-critic/go-critic/issues/845
|
|
|
|
- ifElseChain
|
|
|
|
- octalLiteral
|
|
|
|
- whyNoLint
|
|
|
|
- wrapperFunc
|
2020-01-30 20:50:38 +00:00
|
|
|
gocyclo:
|
2022-09-21 03:57:08 +00:00
|
|
|
min-complexity: 15
|
2020-01-30 20:50:38 +00:00
|
|
|
goimports:
|
2022-09-21 03:57:08 +00:00
|
|
|
local-prefixes: github.com/golangci/golangci-lint
|
2020-01-30 20:50:38 +00:00
|
|
|
golint:
|
2022-09-21 03:57:08 +00:00
|
|
|
min-confidence: 0
|
2020-01-30 20:50:38 +00:00
|
|
|
gomnd:
|
|
|
|
settings:
|
|
|
|
mnd:
|
2022-09-21 03:57:08 +00:00
|
|
|
# don't include the "operation" and "assign"
|
|
|
|
checks: argument,case,condition,return
|
2020-01-30 20:50:38 +00:00
|
|
|
govet:
|
|
|
|
check-shadowing: true
|
|
|
|
settings:
|
2022-09-21 03:57:08 +00:00
|
|
|
printf:
|
|
|
|
funcs:
|
2020-01-30 20:50:38 +00:00
|
|
|
- (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:
|
2022-09-21 03:57:08 +00:00
|
|
|
line-length: 140
|
2020-01-30 20:50:38 +00:00
|
|
|
maligned:
|
|
|
|
suggest-new: true
|
|
|
|
misspell:
|
|
|
|
locale: US
|
2022-09-21 03:57:08 +00:00
|
|
|
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
|
2020-01-30 20:50:38 +00:00
|
|
|
|
|
|
|
linters:
|
2022-09-21 03:57:08 +00:00
|
|
|
# please, do not use `enable-all`: it's deprecated and will be removed soon.
|
|
|
|
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
|
|
|
|
disable-all: true
|
2020-01-30 20:50:38 +00:00
|
|
|
enable:
|
2022-09-21 03:57:08 +00:00
|
|
|
- bodyclose
|
|
|
|
- deadcode
|
|
|
|
- depguard
|
|
|
|
- dogsled
|
|
|
|
- dupl
|
|
|
|
- errcheck
|
|
|
|
- exhaustive
|
|
|
|
- funlen
|
|
|
|
- gochecknoinits
|
|
|
|
- goconst
|
|
|
|
- gocritic
|
|
|
|
- gocyclo
|
|
|
|
- gofmt
|
|
|
|
- goimports
|
|
|
|
- golint
|
|
|
|
- gomnd
|
|
|
|
- goprintffuncname
|
|
|
|
- gosec
|
|
|
|
- gosimple
|
2020-01-30 20:50:38 +00:00
|
|
|
- govet
|
2022-09-21 03:57:08 +00:00
|
|
|
- ineffassign
|
|
|
|
- interfacer
|
|
|
|
- lll
|
|
|
|
- misspell
|
|
|
|
- nakedret
|
|
|
|
- noctx
|
|
|
|
- nolintlint
|
|
|
|
- rowserrcheck
|
|
|
|
- scopelint
|
|
|
|
- staticcheck
|
|
|
|
- structcheck
|
|
|
|
- stylecheck
|
|
|
|
- typecheck
|
|
|
|
- unconvert
|
|
|
|
- unparam
|
2020-01-30 20:50:38 +00:00
|
|
|
- unused
|
2022-09-21 03:57:08 +00:00
|
|
|
- varcheck
|
|
|
|
- whitespace
|
|
|
|
|
|
|
|
# don't enable:
|
|
|
|
# - asciicheck
|
|
|
|
# - gochecknoglobals
|
|
|
|
# - gocognit
|
|
|
|
# - godot
|
|
|
|
# - godox
|
|
|
|
# - goerr113
|
|
|
|
# - maligned
|
|
|
|
# - nestif
|
|
|
|
# - prealloc
|
|
|
|
# - testpackage
|
|
|
|
# - wsl
|
2020-01-30 20:50:38 +00:00
|
|
|
|
|
|
|
issues:
|
|
|
|
# Excluding configuration per-path, per-linter, per-text and per-source
|
|
|
|
exclude-rules:
|
|
|
|
- path: _test\.go
|
|
|
|
linters:
|
2022-09-21 03:57:08 +00:00
|
|
|
- gomnd
|
2020-01-30 20:50:38 +00:00
|
|
|
|
2022-09-21 03:57:08 +00:00
|
|
|
# https://github.com/go-critic/go-critic/issues/926
|
2020-01-30 20:50:38 +00:00
|
|
|
- linters:
|
2022-09-21 03:57:08 +00:00
|
|
|
- gocritic
|
|
|
|
text: "unnecessaryDefer:"
|
2020-01-30 20:50:38 +00:00
|
|
|
|
2022-09-21 03:57:08 +00:00
|
|
|
# TODO temporary rule, must be removed
|
|
|
|
# seems related to v0.34.1, but I was not able to reproduce locally,
|
|
|
|
# I was also not able to reproduce in the CI of a fork,
|
|
|
|
# only the golangci-lint CI seems to be affected by this invalid analysis.
|
|
|
|
- path: pkg/golinters/scopelint.go
|
|
|
|
text: 'directive `//nolint:interfacer` is unused for linter interfacer'
|
2020-01-30 20:50:38 +00:00
|
|
|
|
2022-09-21 03:57:08 +00:00
|
|
|
run:
|
|
|
|
skip-dirs:
|
|
|
|
- test/testdata_etc
|
|
|
|
- internal/cache
|
|
|
|
- internal/renameio
|
|
|
|
- internal/robustio
|
|
|
|
|
|
|
|
# golangci.com configuration
|
|
|
|
# https://github.com/golangci/golangci/wiki/Configuration
|
|
|
|
service:
|
|
|
|
golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly
|
|
|
|
prepare:
|
|
|
|
- echo "here I can run custom commands, but no preparation needed for this repo"
|