2023-02-19 15:05:59 +00:00
|
|
|
---
|
|
|
|
|
run:
|
|
|
|
|
concurrency: 12
|
|
|
|
|
timeout: 1m
|
|
|
|
|
issues-exit-code: 1
|
|
|
|
|
tests: true
|
|
|
|
|
# list of build tags, all linters use it. Default is empty list.
|
2025-02-17 15:42:50 +00:00
|
|
|
build-tags: ['testing']
|
2023-02-19 15:05:59 +00:00
|
|
|
|
|
|
|
|
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
|
|
|
|
|
# If invoked with -mod=readonly, the go command is disallowed from the implicit
|
|
|
|
|
# automatic updating of go.mod described above. Instead, it fails when any changes
|
|
|
|
|
# to go.mod are needed. This setting is most useful to check that go.mod does
|
|
|
|
|
# not need updates, such as in a continuous integration and testing system.
|
|
|
|
|
# If invoked with -mod=vendor, the go command assumes that the vendor
|
|
|
|
|
# directory holds the correct copies of dependencies and ignores
|
|
|
|
|
# the dependency descriptions in go.mod.
|
|
|
|
|
modules-download-mode: vendor
|
|
|
|
|
|
|
|
|
|
# output configuration options
|
|
|
|
|
output:
|
|
|
|
|
# print lines of code with issue, default is true
|
|
|
|
|
print-issued-lines: true
|
|
|
|
|
|
|
|
|
|
# print linter name in the end of issue text, default is true
|
|
|
|
|
print-linter-name: true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#It's a .golangci.yml config file of this repo: we enable more linters than the default and have more strict settings:
|
|
|
|
|
|
|
|
|
|
linters-settings:
|
|
|
|
|
dupl:
|
|
|
|
|
threshold: 100
|
|
|
|
|
funlen:
|
|
|
|
|
lines: 100
|
|
|
|
|
statements: 50
|
|
|
|
|
goconst:
|
|
|
|
|
min-len: 2
|
|
|
|
|
min-occurrences: 2
|
|
|
|
|
gocritic:
|
|
|
|
|
enabled-tags:
|
|
|
|
|
- diagnostic
|
|
|
|
|
- experimental
|
|
|
|
|
- opinionated
|
|
|
|
|
- performance
|
|
|
|
|
- style
|
|
|
|
|
disabled-checks:
|
|
|
|
|
- ifElseChain
|
|
|
|
|
- octalLiteral
|
|
|
|
|
- unnamedResult
|
|
|
|
|
- whyNoLint
|
|
|
|
|
- wrapperFunc
|
|
|
|
|
gocyclo:
|
|
|
|
|
min-complexity: 15
|
|
|
|
|
goimports:
|
|
|
|
|
local-prefixes: github.com/golangci/golangci-lint
|
|
|
|
|
govet:
|
|
|
|
|
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
|
|
|
|
|
misspell:
|
|
|
|
|
locale: US
|
|
|
|
|
|
|
|
|
|
linters:
|
|
|
|
|
# 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
|
|
|
|
|
enable:
|
|
|
|
|
- asasalint
|
|
|
|
|
- asciicheck
|
|
|
|
|
- bidichk
|
|
|
|
|
- bodyclose
|
|
|
|
|
- containedctx
|
|
|
|
|
- contextcheck
|
|
|
|
|
- cyclop
|
|
|
|
|
- decorder
|
|
|
|
|
- dogsled
|
|
|
|
|
- dupl
|
|
|
|
|
- dupword
|
|
|
|
|
- durationcheck
|
|
|
|
|
- errcheck
|
|
|
|
|
- errchkjson
|
|
|
|
|
- errname
|
|
|
|
|
- errorlint
|
|
|
|
|
- exhaustive
|
|
|
|
|
- funlen
|
|
|
|
|
- gci
|
|
|
|
|
- gocognit
|
|
|
|
|
- goconst
|
|
|
|
|
- gocritic
|
|
|
|
|
- gocyclo
|
2023-02-25 03:33:38 +00:00
|
|
|
# - godox
|
2025-02-13 17:19:37 +00:00
|
|
|
- err113
|
2023-02-19 15:05:59 +00:00
|
|
|
- gofmt
|
|
|
|
|
- goheader
|
|
|
|
|
- goimports
|
2025-02-13 17:19:37 +00:00
|
|
|
- mnd
|
2023-02-19 15:05:59 +00:00
|
|
|
- gomoddirectives
|
|
|
|
|
- gomodguard
|
|
|
|
|
- goprintffuncname
|
|
|
|
|
- gosec
|
|
|
|
|
- gosimple
|
|
|
|
|
- govet
|
|
|
|
|
- grouper
|
|
|
|
|
- importas
|
|
|
|
|
- ineffassign
|
|
|
|
|
- interfacebloat
|
2023-02-24 16:12:35 +00:00
|
|
|
#- ireturn
|
2023-02-19 15:05:59 +00:00
|
|
|
- lll
|
|
|
|
|
- loggercheck
|
|
|
|
|
- maintidx
|
|
|
|
|
- makezero
|
|
|
|
|
- misspell
|
|
|
|
|
- nestif
|
|
|
|
|
- nilerr
|
|
|
|
|
- nilnil
|
|
|
|
|
- noctx
|
|
|
|
|
- nosprintfhostport
|
|
|
|
|
- prealloc
|
|
|
|
|
- predeclared
|
|
|
|
|
- promlinter
|
|
|
|
|
- reassign
|
|
|
|
|
- revive
|
|
|
|
|
- rowserrcheck
|
|
|
|
|
- sqlclosecheck
|
|
|
|
|
- staticcheck
|
|
|
|
|
- stylecheck
|
|
|
|
|
- testableexamples
|
2023-02-24 16:12:35 +00:00
|
|
|
#- testpackage
|
2023-02-19 15:05:59 +00:00
|
|
|
- thelper
|
|
|
|
|
- unconvert
|
|
|
|
|
- unparam
|
|
|
|
|
- unused
|
|
|
|
|
- usestdlibvars
|
|
|
|
|
- wastedassign
|
|
|
|
|
- whitespace
|
|
|
|
|
- wrapcheck
|
|
|
|
|
|
|
|
|
|
# don't enable:
|
|
|
|
|
|
|
|
|
|
issues:
|
|
|
|
|
exclude:
|
|
|
|
|
- 'shadow: declaration of "err" shadows declaration at'
|
|
|
|
|
# Excluding configuration per-path, per-linter, per-text and per-source
|
|
|
|
|
exclude-rules:
|
|
|
|
|
- path: _test\.go
|
|
|
|
|
linters:
|
|
|
|
|
- funlen
|
|
|
|
|
- cyclop
|
|
|
|
|
|