aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Yong Tang <yongtang@users.noreply.github.com> 2017-02-22 10:28:04 -0800
committerGravatar John Belamaric <jbelamaric@infoblox.com> 2017-02-22 13:28:04 -0500
commit43c2fcc1efb9d5d98de8c828084d24edd97c10c5 (patch)
tree74f1c750bb8990f1b73271f06934b641c44ff443 /Makefile
parent4723fb941893ed34f9106077891ecc5ed1e4d576 (diff)
downloadcoredns-43c2fcc1efb9d5d98de8c828084d24edd97c10c5.tar.gz
coredns-43c2fcc1efb9d5d98de8c828084d24edd97c10c5.tar.zst
coredns-43c2fcc1efb9d5d98de8c828084d24edd97c10c5.zip
Add dependency of `go fmt` in `Makefile` (#553)
This fix adds the dependency of `go fmt` in `Makefile` so that any new check in will have to properly fmt the source code with `gofmt -s -w`.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index fc8758d5f..ecd690786 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ docker: deps
docker tag $(DOCKER_IMAGE_NAME):latest $(DOCKER_IMAGE_NAME):$(DOCKER_VERSION)
.PHONY: deps
-deps:
+deps: fmt
go get ${BUILD_VERBOSE}
.PHONY: test
@@ -55,6 +55,12 @@ core/zmiddleware.go core/dnsserver/zdirectives.go: middleware.cfg
gen:
go generate coredns.go
+.PHONY: fmt
+fmt:
+ ## run go fmt
+ @test -z "$$(gofmt -s -l . | grep -v vendor/ | tee /dev/stderr)" || \
+ (echo "please format Go code with 'gofmt -s -w'" && false)
+
.PHONY: distclean
distclean: clean
# Clean all dependencies and build artifacts