From d8d27730838758d78f9a4d70ed119edb73c478b9 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Thu, 9 Aug 2018 11:55:57 -0700 Subject: Makefile lint rule now tests gofmt output and runs go vet correctly The `lint` rule was previous surfacing purely whitespace output of `gofmt` as a failure and running `go tool vet` instead of `go vet` (the former accepts source files as arguments, the latter takes package names). A real lint error in `config/node.go` was also fixed. Change-Id: I7f13dcbb45a448f1ecac87e97527a7f4ed4d2c48 --- Makefile | 4 ++-- config/node.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0e94470..3fbc19d 100644 --- a/Makefile +++ b/Makefile @@ -29,9 +29,9 @@ lint: @go list -f $(GO_LIST_GOFILES) ./... | while read f; do \ gofmt -e -d "$${f}" >> .lint-gofmt.diff; \ done - @test ! -s .lint-gofmt.diff || (echo "gofmt found errors:"; cat .lint-gofmt.diff; exit 1) + @test -z "$(grep '[^[:blank:]]' .lint-gofmt.diff)" || (echo "gofmt found errors:"; cat .lint-gofmt.diff; exit 1) golint -set_exit_status $(GO_PACKAGES) - go tool vet -composites=false $(GO_PACKAGES) + go vet -composites=false $(GO_PACKAGES) unit: go test -ldflags "$(GO_LDFLAGS)" $(GO_PACKAGES) diff --git a/config/node.go b/config/node.go index 9256fce..2800e61 100644 --- a/config/node.go +++ b/config/node.go @@ -1,8 +1,8 @@ package config import ( - "path" "gerrit.wikimedia.org/r/blubber/build" + "path" ) // NodeConfig holds configuration fields related to the Node environment and -- cgit v1.2.1