Last active
August 29, 2015 14:05
-
-
Save capoferro/53dcddaa08cffab0c073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fmt_targetfile:=.gofmt | |
build: check_format | |
check_format: $(fmt_targetfile) | |
@if [[ `cat $(fmt_targetfile)` != "" ]]; then \ | |
echo "These need to be formatted:\n\t$(shell cat $(fmt_targetfile))"; \ | |
else \ | |
echo 'Good to go!'; \ | |
fi | |
# .fmt_message ensures this regenerates the file every run | |
$(fmt_targetfile): fmt_message | |
@gofmt -l $(shell git ls-files | grep .go) >$@ | |
.PHONY: fmt_message | |
fmt_message: | |
@echo "Ensuring .go files are formatted correctly..." | |
.PHONY: clean | |
clean: | |
rm $(fmt_targetfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment