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;