From 1234b1353c53570112109192ad82572caa68fd4f Mon Sep 17 00:00:00 2001 From: David Campbell Date: Sat, 22 Oct 2016 17:36:44 -0700 Subject: [PATCH] make fmt - `gofmt` simplify and write to source --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9a8204f7b..da977067f 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ dev: deps ## Build and install a development build @PACKER_DEV=1 GO15VENDOREXPERIMENT=1 sh -c "$(CURDIR)/scripts/build.sh" fmt: ## Format Go code - go fmt `go list ./... | grep -v vendor` + @gofmt -s -w `go list -f {{.Dir}} ./... | grep -v "/vendor/"` # Install js-beautify with npm install -g js-beautify fmt-examples: @@ -52,7 +52,7 @@ generate: deps ## Generate dynamically generated code go generate . gofmt -w command/plugin.go -test: deps ## Run unit tests +test: fmt deps ## Run unit tests @go test $(TEST) $(TESTARGS) -timeout=2m @go tool vet $(VET) ; if [ $$? -eq 1 ]; then \ echo "ERROR: Vet found problems in the code."; \