From 547298587070e8e5406b5bf99de657f8cf04f95c Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 5 Aug 2021 16:26:50 -0300 Subject: [PATCH] dev: add revive linter --- Makefile | 3 +++ revive.toml | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 revive.toml diff --git a/Makefile b/Makefile index 7ad63f9..0350d9c 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ run: build install: build sudo cp ./$(BINARY_NAME) /usr/bin/ +lint: + revive -formatter friendly -config revive.toml -exclude ./player/mpv ./... + tidy: go mod tidy diff --git a/revive.toml b/revive.toml new file mode 100644 index 0000000..9910838 --- /dev/null +++ b/revive.toml @@ -0,0 +1,24 @@ +ignoreGeneratedHeader = false +severity = "warning" +confidence = 0.8 +errorCode = 0 +warningCode = 0 + +[rule.blank-imports] +[rule.context-as-argument] +[rule.context-keys-type] +[rule.dot-imports] +[rule.error-return] +[rule.error-strings] +[rule.error-naming] +[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]