add linting

This commit is contained in:
Jeffrey Paul 2019-11-07 12:49:35 -08:00
parent 12913cc4ff
commit 091d2b3f44
3 changed files with 31 additions and 3 deletions

View File

@ -8,6 +8,4 @@ steps:
commands:
- go get -v
- make build
- go get golang.org/x/lint
- golint ./...
- make lint

25
.revive.toml Normal file
View File

@ -0,0 +1,25 @@
ignoreGeneratedHeader = false
severity = "warning"
confidence = 0.8
errorCode = 1
warningCode = 1
[rule.blank-imports]
[rule.context-as-argument]
[rule.context-keys-type]
[rule.dot-imports]
[rule.error-return]
[rule.error-strings]
[rule.error-naming]
[rule.exported]
[rule.if-return]
[rule.increment-decrement]
[rule.var-naming]
[rule.var-declaration]
[rule.package-comments]
[rule.range]
[rule.receiver-naming]
[rule.time-naming]
[rule.unexported-return]
[rule.indent-error-flow]
[rule.errorf]

View File

@ -42,6 +42,11 @@ clean:
fmt:
go fmt *.go
lint:
go get -u github.com/mgechev/revive
revive -config .revive.toml -exclude=./vendor/... ./... || exit 1
test: build-docker-image
dist: build-docker-image