From 6075d30a545b6b94dedaabafe8f8fdcbe426145c Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 4 Jun 2017 21:42:07 -0500 Subject: [PATCH] feat: check misspelling (#234) --- .drone.yml | 2 ++ Makefile | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/.drone.yml b/.drone.yml index 28117a3..3b745e1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,6 +21,8 @@ pipeline: - make build - make embedmd - make test-vendor + - make misspell-check + - make fmt-check - coverage all # send coverage report - make coverage diff --git a/Makefile b/Makefile index ec71cbd..074da4d 100644 --- a/Makefile +++ b/Makefile @@ -89,6 +89,17 @@ build: $(EXECUTABLE) $(EXECUTABLE): $(SOURCES) go build -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o bin/$@ +misspell-check: + @hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ + go get -u github.com/client9/misspell/cmd/misspell; \ + fi + @diff=$$(misspell $(GOFILES)); \ + if [ -n "$$diff" ]; then \ + echo "Please fix the misspelling:"; \ + echo "$${diff}"; \ + exit 1; \ + fi; + test: fmt-check for PKG in $(PACKAGES); do go test -v -cover -coverprofile $$GOPATH/src/$$PKG/coverage.txt $$PKG || exit 1; done;