131 lines
3.1 KiB
YAML
131 lines
3.1 KiB
YAML
version: "2"
|
|
linters:
|
|
enable:
|
|
- asciicheck
|
|
- bidichk
|
|
- errorlint
|
|
- forbidigo
|
|
- gocognit
|
|
- goconst
|
|
- gocritic
|
|
- makezero
|
|
- misspell
|
|
- musttag
|
|
- nestif
|
|
- nilerr
|
|
- nilnil
|
|
- nonamedreturns
|
|
- protogetter
|
|
- sloglint
|
|
- tagalign
|
|
- unconvert
|
|
- wastedassign
|
|
settings:
|
|
errcheck:
|
|
disable-default-exclusions: true
|
|
check-type-assertions: true
|
|
exclude-functions:
|
|
- (net/http.ResponseWriter).Write
|
|
- (*bytes.Buffer).Write
|
|
- File.Close
|
|
- (hash.Hash).Write
|
|
- (*database/sql.Tx).Rollback
|
|
forbidigo:
|
|
forbid:
|
|
- pattern: ^err.*\.Error.*$
|
|
msg: please use %w to wrap errors
|
|
- pattern: ^os.LookupEnv$
|
|
msg: do not use env vars, use command line arguments
|
|
- pattern: ^os.Getenv$
|
|
msg: do not use env vars, use command line arguments
|
|
- pattern: ^log.Fatal$
|
|
msg: do not use log.Fatal
|
|
- pattern: ^os.Exit$
|
|
msg: do not use os.Exit
|
|
- pattern: ^panic$
|
|
msg: do not use panic
|
|
- pattern: ^log\.Print
|
|
msg: use slog instead of standard log package
|
|
- pattern: ^log\.Printf
|
|
msg: use slog instead of standard log package
|
|
- pattern: ^log\.Println
|
|
msg: use slog instead of standard log package
|
|
- pattern: ^http.DefaultClient$
|
|
msg: do not use http.DefaultClient, use a custom client instead
|
|
- pattern: ^slog.Default$
|
|
msg: do not use slog.Default, use a custom logger instead
|
|
- pattern: ^slog.SetDefault$
|
|
msg: do not use slog.Default, use a custom logger instead
|
|
analyze-types: true
|
|
gocritic:
|
|
disabled-checks:
|
|
- paramTypeCombine
|
|
- unnamedResult
|
|
- importShadow
|
|
- octalLiteral
|
|
enabled-tags:
|
|
- diagnostic
|
|
- style
|
|
- performance
|
|
settings:
|
|
hugeParam:
|
|
sizeThreshold: 512
|
|
rangeValCopy:
|
|
sizeThreshold: 512
|
|
skipTestFuncs: true
|
|
misspell:
|
|
ignore-rules:
|
|
- mosquitto
|
|
exclusions:
|
|
generated: lax
|
|
presets:
|
|
- comments
|
|
- common-false-positives
|
|
- legacy
|
|
- std-error-handling
|
|
rules:
|
|
- linters:
|
|
- appendAssign
|
|
- errcheck
|
|
- forbidigo
|
|
- gocognit
|
|
- goconst
|
|
- gocritic
|
|
- nestif
|
|
path: _test\.go
|
|
- linters:
|
|
- forbidigo
|
|
- gocritic
|
|
path: cmd/.*/main.go
|
|
text: os.Exit
|
|
- linters:
|
|
- forbidigo
|
|
path: cmd
|
|
text: os.Getenv
|
|
- linters:
|
|
- forbidigo
|
|
path: cmd
|
|
text: slog.Default
|
|
- linters:
|
|
- forbidigo
|
|
path: cmd/.*/main.go
|
|
text: panic
|
|
paths:
|
|
- .*\.pb\.go$
|
|
- third_party$
|
|
- builtin$
|
|
- examples$
|
|
issues:
|
|
max-issues-per-linter: 0
|
|
max-same-issues: 0
|
|
formatters:
|
|
enable:
|
|
- gofmt
|
|
- goimports
|
|
exclusions:
|
|
generated: lax
|
|
paths:
|
|
- .*\.pb\.go$
|
|
- third_party$
|
|
- builtin$
|
|
- examples$ |