diff --git a/.drone.yml b/.drone.yml index fe6a047..0e5f92f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,6 +8,4 @@ steps: commands: - go get -v - make build - - go get golang.org/x/lint - - golint ./... - + - make lint diff --git a/.revive.toml b/.revive.toml new file mode 100644 index 0000000..74743d5 --- /dev/null +++ b/.revive.toml @@ -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] diff --git a/Makefile b/Makefile index c4ce2cd..744f9fc 100644 --- a/Makefile +++ b/Makefile @@ -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