Update linter config
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
d8bb25b41d
commit
40ea3e5e9b
1 changed files with 15 additions and 3 deletions
|
@ -3,14 +3,19 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
run:
|
run:
|
||||||
skip-files:
|
# timeout for analysis, e.g. 30s, 5m, default is 1m
|
||||||
- assets.go
|
timeout: 5m
|
||||||
- bindata.go
|
# Force readonly modules usage for checking
|
||||||
|
modules-download-mode: readonly
|
||||||
|
|
||||||
output:
|
output:
|
||||||
format: tab
|
format: tab
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
|
forbidigo:
|
||||||
|
forbid:
|
||||||
|
- 'fmt\.Errorf' # Should use github.com/pkg/errors
|
||||||
|
|
||||||
funlen:
|
funlen:
|
||||||
lines: 100
|
lines: 100
|
||||||
statements: 60
|
statements: 60
|
||||||
|
@ -19,6 +24,11 @@ linters-settings:
|
||||||
# minimal code complexity to report, 30 by default (but we recommend 10-20)
|
# minimal code complexity to report, 30 by default (but we recommend 10-20)
|
||||||
min-complexity: 15
|
min-complexity: 15
|
||||||
|
|
||||||
|
gomnd:
|
||||||
|
settings:
|
||||||
|
mnd:
|
||||||
|
ignored-functions: 'strconv.Parse\B+'
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
disable-all: true
|
||||||
enable:
|
enable:
|
||||||
|
@ -28,6 +38,7 @@ linters:
|
||||||
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
|
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
|
||||||
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false]
|
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false]
|
||||||
- exportloopref # checks for pointers to enclosing loop variables [fast: true, auto-fix: false]
|
- exportloopref # checks for pointers to enclosing loop variables [fast: true, auto-fix: false]
|
||||||
|
- forbidigo # Forbids identifiers [fast: true, auto-fix: false]
|
||||||
- funlen # Tool for detection of long functions [fast: true, auto-fix: false]
|
- funlen # Tool for detection of long functions [fast: true, auto-fix: false]
|
||||||
- gocognit # Computes and checks the cognitive complexity of functions [fast: true, auto-fix: false]
|
- gocognit # Computes and checks the cognitive complexity of functions [fast: true, auto-fix: false]
|
||||||
- goconst # Finds repeated strings that could be replaced by a constant [fast: true, auto-fix: false]
|
- goconst # Finds repeated strings that could be replaced by a constant [fast: true, auto-fix: false]
|
||||||
|
@ -35,6 +46,7 @@ linters:
|
||||||
- gocyclo # Computes and checks the cyclomatic complexity of functions [fast: true, auto-fix: false]
|
- gocyclo # Computes and checks the cyclomatic complexity of functions [fast: true, auto-fix: false]
|
||||||
- godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]
|
- godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]
|
||||||
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]
|
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]
|
||||||
|
- gofumpt # Gofumpt checks whether code was gofumpt-ed. [fast: true, auto-fix: true]
|
||||||
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports [fast: true, auto-fix: true]
|
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports [fast: true, auto-fix: true]
|
||||||
- gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false]
|
- gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false]
|
||||||
- gosec # Inspects source code for security problems [fast: true, auto-fix: false]
|
- gosec # Inspects source code for security problems [fast: true, auto-fix: false]
|
||||||
|
|
Loading…
Reference in a new issue