mirror of https://github.com/docker/cli.git
golangci-lint: enable more linters
Enables the asasalint, exptostd, fatcontext, gocheckcompilerdirectives, iface, makezero, and spancheck linters. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
615ffee13b
commit
d1e9946ab8
|
@ -26,6 +26,7 @@ formatters:
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
|
- asasalint # Detects "[]any" used as argument for variadic "func(...any)".
|
||||||
- bodyclose
|
- bodyclose
|
||||||
- copyloopvar # Detects places where loop variables are copied.
|
- copyloopvar # Detects places where loop variables are copied.
|
||||||
- depguard
|
- depguard
|
||||||
|
@ -35,11 +36,15 @@ linters:
|
||||||
- errcheck
|
- errcheck
|
||||||
- errchkjson # Detects unsupported types passed to json encoding functions and reports if checks for the returned error can be omitted.
|
- errchkjson # Detects unsupported types passed to json encoding functions and reports if checks for the returned error can be omitted.
|
||||||
- exhaustive # Detects missing options in enum switch statements.
|
- exhaustive # Detects missing options in enum switch statements.
|
||||||
|
- exptostd # Detects functions from golang.org/x/exp/ that can be replaced by std functions.
|
||||||
|
- fatcontext # Detects nested contexts in loops and function literals.
|
||||||
- forbidigo
|
- forbidigo
|
||||||
|
- gocheckcompilerdirectives # Detects invalid go compiler directive comments (//go:).
|
||||||
- gocritic # Metalinter; detects bugs, performance, and styling issues.
|
- gocritic # Metalinter; detects bugs, performance, and styling issues.
|
||||||
- gocyclo
|
- gocyclo
|
||||||
- gosec # Detects security problems.
|
- gosec # Detects security problems.
|
||||||
- govet
|
- govet
|
||||||
|
- iface # Detects incorrect use of interfaces. Currently only used for "identical" interfaces in the same package.
|
||||||
- importas # Enforces consistent import aliases.
|
- importas # Enforces consistent import aliases.
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- makezero # Finds slice declarations with non-zero initial length.
|
- makezero # Finds slice declarations with non-zero initial length.
|
||||||
|
@ -54,6 +59,7 @@ linters:
|
||||||
- predeclared # Detects code that shadows one of Go's predeclared identifiers
|
- predeclared # Detects code that shadows one of Go's predeclared identifiers
|
||||||
- reassign # Detects reassigning a top-level variable in another package.
|
- reassign # Detects reassigning a top-level variable in another package.
|
||||||
- revive # Metalinter; drop-in replacement for golint.
|
- revive # Metalinter; drop-in replacement for golint.
|
||||||
|
- spancheck # Detects mistakes with OpenTelemetry/Census spans.
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- thelper # Detects test helpers without t.Helper().
|
- thelper # Detects test helpers without t.Helper().
|
||||||
- tparallel # Detects inappropriate usage of t.Parallel().
|
- tparallel # Detects inappropriate usage of t.Parallel().
|
||||||
|
|
Loading…
Reference in New Issue