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:
|
2022-09-21 07:34:53 +00:00
|
|
|
threshold: 125
|
2020-01-30 20:50:38 +00:00
|
|
|
funlen:
|
2022-09-21 03:57:08 +00:00
|
|
|
lines: 125
|
|
|
|
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
|
2020-01-30 20:50:38 +00:00
|
|
|
- performance
|
2022-09-21 04:12:13 +00:00
|
|
|
#- style
|
|
|
|
#- opinionated
|
2022-09-21 03:57:08 +00:00
|
|
|
disabled-checks:
|
2022-09-25 03:01:16 +00:00
|
|
|
- commentFormatting
|
|
|
|
- commentedOutCode
|
2022-09-21 03:57:08 +00:00
|
|
|
- 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
|
|
|
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:
|
2022-09-21 03:57:08 +00:00
|
|
|
locale: en_CA
|
|
|
|
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
|
|
|
|
- depguard
|
|
|
|
- dogsled
|
|
|
|
- dupl
|
|
|
|
- errcheck
|
|
|
|
- exhaustive
|
2022-09-21 04:12:13 +00:00
|
|
|
- exportloopref
|
2022-09-21 03:57:08 +00:00
|
|
|
- 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
|
2022-09-21 04:12:13 +00:00
|
|
|
# - deadcode
|
2022-09-21 03:57:08 +00:00
|
|
|
# - gochecknoglobals
|
|
|
|
# - gocognit
|
|
|
|
# - godot
|
|
|
|
# - godox
|
|
|
|
# - goerr113
|
2022-09-21 04:12:13 +00:00
|
|
|
# - golint
|
|
|
|
# - interfacer
|
2022-09-21 03:57:08 +00:00
|
|
|
# - maligned
|
|
|
|
# - nestif
|
|
|
|
# - prealloc
|
2022-09-21 04:12:13 +00:00
|
|
|
## - rowserrcheck
|
|
|
|
# - scopelint
|
|
|
|
# - structcheck
|
2022-09-21 03:57:08 +00:00
|
|
|
# - testpackage
|
2022-09-21 04:12:13 +00:00
|
|
|
# - varcheck
|
2022-09-21 03:57:08 +00:00
|
|
|
# - 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"
|