chore: add golangci-lint task and config
Signed-off-by: Yves Brissaud <yves.brissaud@docker.com>
This commit is contained in:
Родитель
e776e28f1d
Коммит
7d2ec59e56
|
@ -0,0 +1,43 @@
|
|||
linters:
|
||||
enable: # defaults @ top
|
||||
- errcheck
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- staticcheck
|
||||
- typecheck
|
||||
- unused
|
||||
- unconvert
|
||||
- gofmt
|
||||
- misspell
|
||||
- bodyclose
|
||||
- revive
|
||||
- gocyclo
|
||||
- whitespace
|
||||
- sqlclosecheck
|
||||
- goimports
|
||||
- unparam
|
||||
run:
|
||||
deadline: 2m
|
||||
allow-parallel-runners: true
|
||||
concurrency: 2
|
||||
tests: true
|
||||
linters-settings:
|
||||
gosimple:
|
||||
go: '1.19'
|
||||
staticcheck:
|
||||
go: '1.19'
|
||||
stylecheck:
|
||||
go: '1.19'
|
||||
unused:
|
||||
go: '1.19'
|
||||
revive:
|
||||
rules:
|
||||
- name: exported
|
||||
disabled: true
|
||||
issues:
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
exclude-use-default: false
|
||||
output:
|
||||
format: tab
|
|
@ -29,6 +29,10 @@ tasks:
|
|||
- gofmt -w .
|
||||
#- go mod tidy
|
||||
|
||||
go:lint:
|
||||
cmds:
|
||||
- docker run --rm -v $(pwd):/app -v $(go env GOPATH)/pkg:/go/pkg -v $(go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -w /app golangci/golangci-lint:v1.50.1 golangci-lint run -v --timeout 10m
|
||||
|
||||
go:release:
|
||||
cmds:
|
||||
- goreleaser release --rm-dist
|
||||
|
|
Загрузка…
Ссылка в новой задаче