diff --git a/Makefile b/Makefile index b2dc2fe37..9677cb106 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ VETTERS = "asmdecl,assign,atomic,bools,buildtag,cgocall,composites,copylocks,errorsas,httpresponse,loopclosure,lostcancel,nilfunc,printf,shift,stdmethods,structtag,tests,unmarshal,unreachable,unsafeptr,unusedresult" GOFMT_FILES = $(shell go list -f '{{.Dir}}' ./...) +HTML_FILES = $(shell find . -name \*.html) fmtcheck: @command -v goimports > /dev/null 2>&1 || go get golang.org/x/tools/cmd/goimports @@ -30,6 +31,14 @@ fmtcheck: fi .PHONY: fmtcheck +tabcheck: + @CHANGES="$$(awk '/\t/ {print FILENAME,FNR}' $(HTML_FILES))"; \ + if [ -n "$${CHANGES}" ]; then \ + echo "$${CHANGES}\n\n"; \ + exit 1; \ + fi +.PHONY: tabcheck + spellcheck: @command -v misspell > /dev/null 2>&1 || go get github.com/client9/misspell/cmd/misspell @misspell -locale="US" -error -source="text" **/* diff --git a/scripts/presubmit.sh b/scripts/presubmit.sh index 8fb7b4634..c9019b854 100755 --- a/scripts/presubmit.sh +++ b/scripts/presubmit.sh @@ -53,6 +53,13 @@ make spellcheck || { } +echo "↹ Verify tabs" +make tabcheck || { + echo "✋ Found tabs in html." + exit 1 +} + + echo "🔨 Building" go build ./...