Chore: Implement revive (#16200)

Since we do not like some of the default golint rules,
this commit proposes to use https://github.com/mgechev/revive.

And potential revive speed-up should't hurt :).

Right now, presented config (./conf/revive.toml) is permissive,
we might improve it over time however. Fixes for found revive
issues in the code are very limited so it wouldn't be large to review.

Also in this commit:

* Add annotations for makefile commands and declare phony targets

* Rename "gometalinter" script and CI command to "lint"
  since we are doing there a bit more then using gometalinter package

* Add Makefile rules to .editorconfig

* Documentation which mentioned "golint" replaced with revive

Fixes #16109
Ref #16160
This commit is contained in:
Oleg Gaidarenko
2019-03-27 17:53:49 +01:00
committed by GitHub
parent 33d1d427bc
commit 04b3afcd15
10 changed files with 110 additions and 27 deletions
@@ -19,6 +19,7 @@ go get -u github.com/opennota/check/cmd/structcheck
go get -u github.com/mdempsky/unconvert
go get -u github.com/opennota/check/cmd/varcheck
go get -u honnef.co/go/tools/cmd/staticcheck
go get -u github.com/mgechev/revive
exit_if_fail gometalinter --enable-gc --vendor --deadline 10m --disable-all \
--enable=deadcode \
@@ -31,3 +32,4 @@ exit_if_fail gometalinter --enable-gc --vendor --deadline 10m --disable-all \
--enable=staticcheck
exit_if_fail go vet ./pkg/...
exit_if_fail revive -formatter stylish -config ./conf/revive.toml