build(linter): add .golangci.yml

This commit is contained in:
Aiden X 2020-03-30 22:57:55 +08:00
parent 006911d3f7
commit 2bb82e8d81
2 changed files with 41 additions and 1 deletions

View File

@ -28,7 +28,7 @@ jobs:
bash scripts/prepare.sh
- name: Run golangci-lint
run: make linter
uses: Mushus/golangci-linter@v1
- name: Build
run: go build -v ./cmd/bitxhub

40
.golangci.yml Normal file
View File

@ -0,0 +1,40 @@
linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
# - funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
# - golint
# - gomnd
- goprintffuncname
# - gosec
- gosimple
- govet
- ineffassign
# - interfacer
# - lll
- misspell
- nakedret
- rowserrcheck
# - scopelint
- staticcheck
- structcheck
# - stylecheck
- typecheck
- unconvert
# - unparam
# - unused
- varcheck
# - whitespace