From 091d2b3f442f06ce941c66fc6c77a8630d2cd7f4 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Nov 2019 12:49:35 -0800 Subject: [PATCH] add linting --- .drone.yml | 4 +--- .revive.toml | 25 +++++++++++++++++++++++++ Makefile | 5 +++++ 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 .revive.toml 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