From 67a81c13e2be6ee282bed7563008ac86482c1520 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 28 Nov 2017 07:48:00 +0000 Subject: [PATCH] run linter on make test --- Makefile | 18 ++++++++++-------- tests/test_app/main.go | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 11a75664a..cdee195d7 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,8 @@ dist: test: @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; + @ echo "==> Running linter" + @ make metalinter_test @ echo "==> Running go test" @ go test $(PACKAGES) @@ -54,20 +56,20 @@ fmt: get_deps: @ go get -d $(PACKAGES) -tools: +ensure_tools: go get -u -v $(GOTOOLS) + @gometalinter --install -get_vendor_deps: - @ go get github.com/Masterminds/glide +get_vendor_deps: ensure_tools + @rm -rf vendor/ + @echo "--> Running glide install" @ glide install -metalinter: tools - @gometalinter --install +metalinter: protoc --lint_out=. types/*.proto gometalinter --vendor --deadline=600s --enable-all --disable=lll ./... -metalinter_test: tools - @gometalinter --install +metalinter_test: # protoc --lint_out=. types/*.proto gometalinter --vendor --deadline=600s --disable-all \ --enable=maligned \ @@ -103,4 +105,4 @@ build-docker: run-docker: docker run -it --rm -v "$PWD:/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" "tendermint/abci-dev" /bin/bash -.PHONY: all build test fmt get_deps tools protoc install_protoc build-docker run-docker +.PHONY: all build test fmt get_deps ensure_tools protoc install_protoc build-docker run-docker diff --git a/tests/test_app/main.go b/tests/test_app/main.go index 6c75a37e1..a21918f51 100644 --- a/tests/test_app/main.go +++ b/tests/test_app/main.go @@ -35,7 +35,7 @@ func ensureABCIIsUp(typ string, n int) error { } for i := 0; i < n; i++ { - cmd := exec.Command("bash", "-c", cmdString) + cmd := exec.Command("bash", "-c", cmdString) // nolint: gas _, err = cmd.CombinedOutput() if err == nil { break @@ -52,7 +52,7 @@ func testCounter() { } fmt.Printf("Running %s test with abci=%s\n", abciApp, abciType) - cmd := exec.Command("bash", "-c", fmt.Sprintf("abci-cli %s", abciApp)) + cmd := exec.Command("bash", "-c", fmt.Sprintf("abci-cli %s", abciApp)) // nolint: gas cmd.Stdout = os.Stdout if err := cmd.Start(); err != nil { log.Fatalf("starting %q err: %v", abciApp, err)