Merge pull request #4472 from simonpasquier/better-gofmt-msg

Makefile: improve 'make style' reporting
This commit is contained in:
Simon Pasquier 2018-08-08 09:32:17 +02:00 committed by GitHub
commit d6c590018b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -49,7 +49,12 @@ all: style staticcheck unused build test
.PHONY: common-style
common-style:
@echo ">> checking code style"
! $(GOFMT) -d $$(find . -path ./vendor -prune -o -name '*.go' -print) | grep '^'
@fmtRes=$$($(GOFMT) -d $$(find . -path ./vendor -prune -o -name '*.go' -print)); \
if [ -n "$${fmtRes}" ]; then \
echo "gofmt checking failed!"; echo "$${fmtRes}"; echo; \
echo "Please ensure you are using $$($(GO) version) for formatting code."; \
exit 1; \
fi
.PHONY: common-check_license
common-check_license: