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