Add golangci-lint config and lint tasks
- Add .golangci.yml with sensible defaults for the project - Add lint and lint:fix tasks to Taskfile - Remove unused findGitRoot function - Apply gofumpt formatting fixes
This commit is contained in:
64
.golangci.yml
Normal file
64
.golangci.yml
Normal file
@ -0,0 +1,64 @@
|
||||
version: "2"
|
||||
|
||||
linters:
|
||||
default: standard
|
||||
enable:
|
||||
- errcheck
|
||||
- govet
|
||||
- staticcheck
|
||||
- unused
|
||||
- ineffassign
|
||||
- misspell
|
||||
- unconvert
|
||||
- unparam
|
||||
- gosec
|
||||
- prealloc
|
||||
- revive
|
||||
- gocritic
|
||||
- errname
|
||||
- errorlint
|
||||
- nilerr
|
||||
- bodyclose
|
||||
- durationcheck
|
||||
- exhaustive
|
||||
- copyloopvar
|
||||
- perfsprint
|
||||
- usestdlibvars
|
||||
disable:
|
||||
- depguard
|
||||
- funlen
|
||||
- gochecknoglobals
|
||||
- gochecknoinits
|
||||
- lll
|
||||
- wsl
|
||||
- nlreturn
|
||||
- varnamelen
|
||||
- exhaustruct
|
||||
- ireturn
|
||||
- nonamedreturns
|
||||
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- comments
|
||||
- std-error-handling
|
||||
- common-false-positives
|
||||
rules:
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- errcheck
|
||||
- gosec
|
||||
- dupl
|
||||
|
||||
formatters:
|
||||
enable:
|
||||
- gofumpt
|
||||
- goimports
|
||||
|
||||
issues:
|
||||
max-issues-per-linter: 50
|
||||
max-same-issues: 3
|
||||
|
||||
run:
|
||||
timeout: 5m
|
||||
tests: true
|
||||
Reference in New Issue
Block a user