fleet/.golangci.yml

64 lines
1.4 KiB
YAML
Raw Normal View History

linters:
disable-all: true
enable:
- deadcode
- depguard
- gocritic
- gofmt
- govet
- ineffassign
- revive
- rowserrcheck
- sqlclosecheck
- structcheck
- typecheck
- unconvert
- unused
linters-settings:
depguard:
list-type: blacklist
include-go-root: false
packages-with-error-message:
- github.com/rotisserie/eris: "use ctxerr.New or ctxerr.Wrap[f] instead"
- github.com/pkg/errors: "use ctxerr if a context.Context is available or stdlib errors.New / fmt.Errorf with the %w verb"
gocritic:
enabled-checks:
- ruleguard
settings:
ruleguard:
rules: "tools/ci/rules.go"
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: false
revive:
ignoreGeneratedHeader: false
severity: "warning"
confidence: 0.8
errorCode: 0
warningCode: 0
rules:
- name: dot-imports
- name: error-return
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unreachable-code
- name: redefines-builtin-id
issues:
exclude-rules:
- path: server/datastore/mysql/migrations/[^/]+/[^/]+\.go
linters:
- depguard