From 832d0d3d0161eda57d82996d9d3c9c0228eff010 Mon Sep 17 00:00:00 2001 From: Arpad Ryszka Date: Sun, 5 Nov 2017 04:55:37 +0100 Subject: [PATCH] check format on build --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c96b02d..1fa7262 100644 --- a/Makefile +++ b/Makefile @@ -16,9 +16,12 @@ build: $(SOURCES) check: imports build $(PARSERS) go test -test.short -run ^Test -check-all: imports build $(PARSERS) +check-full: imports build $(PARSERS) go test +check-fmt: $(SOURCES) + @if [ "$$(gofmt -s -d $(SOURCES))" != "" ]; then false; else true; fi + .coverprofile: $(SOURCES) imports go test -coverprofile .coverprofile @@ -41,14 +44,14 @@ cpu: cpu.out fmt: $(SOURCES) @gofmt -w -s $(SOURCES) -precommit: fmt build check-all +precommit: fmt build check-full clean: @rm -f *.test @rm -f cpu.out @go clean -i ./... -ci-trigger: deps build check-all +ci-trigger: deps build check-all check-fmt ifeq ($(TRAVIS_BRANCH)_$(TRAVIS_PULL_REQUEST), master_false) make publish-coverage endif