From 3f9f185625016ab33dfb284baaba00f6081fcd54 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Wed, 26 Feb 2020 10:44:08 +0000 Subject: [PATCH] Update fmt target Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index db03eb2db..00c58a7e9 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ Version := $(shell git describe --tags --dirty) GitCommit := $(shell git rev-parse HEAD) LDFLAGS := "-s -w -X github.com/alexellis/arkade/cmd.Version=$(Version) -X github.com/alexellis/arkade/cmd.GitCommit=$(GitCommit)" PLATFORM := $(shell ./hack/platform-tag.sh) +SOURCE_DIRS = cmd pkg main.go .PHONY: all @@ -9,6 +10,10 @@ PLATFORM := $(shell ./hack/platform-tag.sh) build: go build +.PHONY: fmtcheck +fmt: ## Checks for style violation using gofmt + @gofmt -l -s $(SOURCE_DIRS) | grep ".*\.go"; if [ "$$?" = "0" ]; then echo "Run gofmt -w -s ./path" && exit 1; fi + .PHONY: test test: CGO_ENABLED=0 go test $(shell go list ./... | grep -v /vendor/|xargs echo) -cover