feat: check misspelling (#234)

This commit is contained in:
Bo-Yi Wu 2017-06-04 21:42:07 -05:00 committed by GitHub
parent fb7109835a
commit 6075d30a54
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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;