check format on build

This commit is contained in:
Arpad Ryszka 2017-11-05 04:55:37 +01:00
parent c32e326311
commit 832d0d3d01

View File

@ -16,9 +16,12 @@ build: $(SOURCES)
check: imports build $(PARSERS) check: imports build $(PARSERS)
go test -test.short -run ^Test go test -test.short -run ^Test
check-all: imports build $(PARSERS) check-full: imports build $(PARSERS)
go test go test
check-fmt: $(SOURCES)
@if [ "$$(gofmt -s -d $(SOURCES))" != "" ]; then false; else true; fi
.coverprofile: $(SOURCES) imports .coverprofile: $(SOURCES) imports
go test -coverprofile .coverprofile go test -coverprofile .coverprofile
@ -41,14 +44,14 @@ cpu: cpu.out
fmt: $(SOURCES) fmt: $(SOURCES)
@gofmt -w -s $(SOURCES) @gofmt -w -s $(SOURCES)
precommit: fmt build check-all precommit: fmt build check-full
clean: clean:
@rm -f *.test @rm -f *.test
@rm -f cpu.out @rm -f cpu.out
@go clean -i ./... @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) ifeq ($(TRAVIS_BRANCH)_$(TRAVIS_PULL_REQUEST), master_false)
make publish-coverage make publish-coverage
endif endif