feat: replace golint with revive

This commit is contained in:
Bo-Yi Wu
2019-01-26 14:08:46 +08:00
parent efda9f893d
commit 3aaf33228f
2 changed files with 28 additions and 3 deletions
+25
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]
+3 -3
View File
@@ -42,10 +42,10 @@ errcheck:
errcheck $(PACKAGES)
lint:
@which golint > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/golang/lint/golint; \
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/mgechev/revive; \
fi
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
revive -config .revive.toml ./... || exit 1
unconvert:
@which unconvert > /dev/null; if [ $$? -ne 0 ]; then \