11GOTOOLS = \
2- github.com/golang/dep/cmd/dep \
3- gopkg.in/alecthomas/gometalinter.v2
4- GOTOOLS_CHECK = dep gometalinter.v2
2+ github.com/golangci/golangci-lint/cmd/golangci-lint
3+ GOTOOLS_CHECK = golangci-lint
54
6- all : check_tools get_vendor_deps test metalinter
5+ all : check_tools test
76
87# #######################################
98# ## Build
@@ -25,17 +24,11 @@ check_tools:
2524
2625get_tools :
2726 @echo " --> Installing tools"
28- go get -u -v $(GOTOOLS )
29- @gometalinter.v2 --install
27+ go get -v $(GOTOOLS )
3028
3129update_tools :
3230 @echo " --> Updating tools"
33- @go get -u $(GOTOOLS )
34-
35- get_vendor_deps :
36- @rm -rf vendor/
37- @echo " --> Running dep ensure"
38- @dep ensure
31+ @go get -u -v $(GOTOOLS )
3932
4033
4134# #######################################
@@ -49,15 +42,17 @@ gofuzz_binary:
4942 rm -rf tests/fuzz/binary/crashers/
5043 rm -rf tests/fuzz/binary/suppressions/
5144 go run tests/fuzz/binary/init-corpus/main.go --corpus-parent=tests/fuzz/binary
52- go-fuzz-build github.com/tendermint/go-amino/tests/fuzz/binary
53- go-fuzz -bin=./fuzz_binary-fuzz.zip -workdir=tests/fuzz/binary
45+ # TODO: update when https://github.com/dvyukov/go-fuzz/issues/195 is resolved
46+ GO111MODULE=off go-fuzz-build github.com/tendermint/go-amino/tests/fuzz/binary
47+ GO111MODULE=off go-fuzz -bin=./fuzz_binary-fuzz.zip -workdir=tests/fuzz/binary
5448
5549gofuzz_json :
5650 rm -rf tests/fuzz/json/corpus/
5751 rm -rf tests/fuzz/json/crashers/
5852 rm -rf tests/fuzz/json/suppressions/
59- go-fuzz-build github.com/tendermint/go-amino/tests/fuzz/json
60- go-fuzz -bin=./fuzz_json-fuzz.zip -workdir=tests/fuzz/json
53+ # TODO: update when https://github.com/dvyukov/go-fuzz/issues/195 is resolved
54+ GO111MODULE=off go-fuzz-build github.com/tendermint/go-amino/tests/fuzz/json
55+ GO111MODULE=off go-fuzz -bin=./fuzz_json-fuzz.zip -workdir=tests/fuzz/json
6156
6257
6358# #######################################
@@ -66,46 +61,12 @@ gofuzz_json:
6661fmt :
6762 @go fmt ./...
6863
69- metalinter :
70- @echo " ==> Running linter"
71- gometalinter.v2 --vendor --deadline=600s --disable-all \
72- --enable=deadcode \
73- --enable=goconst \
74- --enable=goimports \
75- --enable=gosimple \
76- --enable=ineffassign \
77- --enable=megacheck \
78- --enable=misspell \
79- --enable=staticcheck \
80- --enable=safesql \
81- --enable=structcheck \
82- --enable=unconvert \
83- --enable=unused \
84- --enable=varcheck \
85- --enable=vetshadow \
86- ./...
87-
88- # --enable=maligned \
89- #--enable=gas \
90- #--enable=aligncheck \
91- #--enable=dupl \
92- #--enable=errcheck \
93- #--enable=gocyclo \
94- #--enable=golint \ <== comments on anything exported
95- # --enable=gotype \
96- #--enable=interfacer \
97- #--enable=unparam \
98- #--enable=vet \
99-
100- metalinter_all :
101- protoc $(INCLUDE ) --lint_out=. types/* .proto
102- gometalinter.v2 --vendor --deadline=600s --enable-all --disable=lll ./...
103-
104-
105- test_golang1.10rc :
106- docker run -it -v " $( CURDIR) :/go/src/github.com/tendermint/go-amino" -w " /go/src/github.com/tendermint/go-amino" golang:1.10-rc /bin/bash -ci " make get_tools all"
64+ # look into .golangci.yml for enabling / disabling linters
65+ lint :
66+ @echo " --> Running linter"
67+ @golangci-lint run
10768
10869# To avoid unintended conflicts with file names, always add to .PHONY
10970# unless there is a reason not to.
11071# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
111- .PHONY : build install check_tools get_tools update_tools get_vendor_deps test fmt metalinter metalinter_all
72+ .PHONY : build install check_tools get_tools fmt lint test
0 commit comments