Chore: a bit of spring cleaning (#16710)

* Chore: use early return technic everywhere

And enable "indent-error-flow" revive rule

* Chore: remove if-return rule from revive config

* Chore: improve error messages

And enable "error-strings" revive rule

* Chore: enable "error-naming" revive rule

* Chore: make linter happy

* Chore: do not duplicate gofmt execution

* Chore: make linter happy

* Chore: address the pull review comments
This commit is contained in:
Oleg Gaidarenko
2019-04-23 11:24:47 +03:00
committed by GitHub
parent 5ce5840ae0
commit 54c1bf0cc9
21 changed files with 65 additions and 74 deletions
-3
View File
@@ -10,9 +10,6 @@ function exit_if_fail {
fi
}
echo "running go fmt"
exit_if_fail test -z \"'$(gofmt -s -l ./pkg | tee /dev/stderr)'\"
echo "building backend with install to cache pkgs"
exit_if_fail time go install ./pkg/cmd/grafana-server
+3 -5
View File
@@ -9,6 +9,9 @@ errorCode = 0
[rule.range]
[rule.superfluous-else]
[rule.modifies-parameter]
[rule.indent-error-flow]
[rule.error-strings]
[rule.error-naming]
# This can be checked by other tools like megacheck
[rule.unreachable-code]
@@ -17,11 +20,6 @@ errorCode = 0
# [rule.unexported-return]
# [rule.exported]
# [rule.var-naming]
# [error-naming]
# [rule.dot-imports]
# [blank-imports]
# [rule.receiver-naming]
# [error-strings]
# [rule.if-return]
# [rule.indent-error-flow]
# [rule.blank-imports]