diff options
author | Dan Duvall <dduvall@wikimedia.org> | 2018-08-09 11:55:57 -0700 |
---|---|---|
committer | Dan Duvall <dduvall@wikimedia.org> | 2018-08-09 11:58:14 -0700 |
commit | d8d27730838758d78f9a4d70ed119edb73c478b9 (patch) | |
tree | 9983c0eb8b52603702dafdf502793b9e39497873 | |
parent | 7b1c01c18b35f4294bd583a2cefced51872c4ce1 (diff) | |
download | blubber-d8d27730838758d78f9a4d70ed119edb73c478b9.tar.gz |
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
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | config/node.go | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -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 |