71 lines
2.3 KiB
YAML
71 lines
2.3 KiB
YAML
version: "2"
|
|
|
|
linters:
|
|
default: none
|
|
enable:
|
|
- asasalint # checks for pass []any as any in variadic func(...any)
|
|
- asciicheck # checks that your code does not contain non-ASCII identifiers
|
|
- bidichk # checks for dangerous unicode character sequences
|
|
- bodyclose # checks whether HTTP response body is closed successfully
|
|
- copyloopvar # detects places where loop variables are copied (Go 1.22+)
|
|
- durationcheck # checks for two durations multiplied together
|
|
- exptostd # detects functions from golang.org/x/exp/ that can be replaced by std functions
|
|
- fatcontext # detects nested contexts in loops
|
|
- gocheckcompilerdirectives # validates go compiler directive comments (//go:)
|
|
- gochecksumtype # checks exhaustiveness on Go "sum types"
|
|
- gocritic # provides diagnostics that check for bugs, performance and style issues
|
|
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
|
|
- goprintffuncname # checks that printf-like functions are named with f at the end
|
|
- govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
|
|
- ineffassign # detects when assignments to existing variables are not used
|
|
- nilerr # finds the code that returns nil even if it checks that the error is not nil
|
|
- nolintlint # reports ill-formed or insufficient nolint directives
|
|
- nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL
|
|
- reassign # checks that package variables are not reassigned
|
|
- unused # checks for unused constants, variables, functions and types
|
|
|
|
# To enable later due to too many issues, and confirm we need them:
|
|
# - gosec
|
|
# - staticcheck
|
|
# - errcheck
|
|
exclusions:
|
|
paths:
|
|
- third-party
|
|
rules:
|
|
- path: _test\.go$
|
|
linters:
|
|
- bodyclose
|
|
- gosec
|
|
settings:
|
|
gocritic:
|
|
disabled-checks:
|
|
- appendAssign
|
|
disabled-tags:
|
|
- style
|
|
gosec:
|
|
excludes:
|
|
- G110
|
|
- G204
|
|
- G301
|
|
- G302
|
|
- G304
|
|
- G307
|
|
- G404
|
|
config:
|
|
G104:
|
|
os:
|
|
- Setenv
|
|
govet:
|
|
enable:
|
|
- httpresponse
|
|
|
|
formatters:
|
|
enable:
|
|
- gofmt
|
|
exclusions:
|
|
paths:
|
|
- third-party
|
|
|
|
issues:
|
|
max-issues-per-linter: 0
|
|
max-same-issues: 0
|