feat: check misspelling (#234)
This commit is contained in:
parent
fb7109835a
commit
6075d30a54
|
@ -21,6 +21,8 @@ pipeline:
|
||||||
- make build
|
- make build
|
||||||
- make embedmd
|
- make embedmd
|
||||||
- make test-vendor
|
- make test-vendor
|
||||||
|
- make misspell-check
|
||||||
|
- make fmt-check
|
||||||
- coverage all
|
- coverage all
|
||||||
# send coverage report
|
# send coverage report
|
||||||
- make coverage
|
- make coverage
|
||||||
|
|
11
Makefile
11
Makefile
|
@ -89,6 +89,17 @@ build: $(EXECUTABLE)
|
||||||
$(EXECUTABLE): $(SOURCES)
|
$(EXECUTABLE): $(SOURCES)
|
||||||
go build -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o bin/$@
|
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
|
test: fmt-check
|
||||||
for PKG in $(PACKAGES); do go test -v -cover -coverprofile $$GOPATH/src/$$PKG/coverage.txt $$PKG || exit 1; done;
|
for PKG in $(PACKAGES); do go test -v -cover -coverprofile $$GOPATH/src/$$PKG/coverage.txt $$PKG || exit 1; done;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue