From a827f91affd4b3e6211dda733ce9b3bcead3fd81 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Tue, 7 Aug 2018 12:19:19 +0200 Subject: [PATCH] Makefile: improve 'make style' reporting Signed-off-by: Simon Pasquier --- Makefile.common | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.common b/Makefile.common index 61ef11da9..c9d832373 100644 --- a/Makefile.common +++ b/Makefile.common @@ -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: