Add make check-style to travis

This commit is contained in:
Hanzei 2018-10-12 13:38:41 +02:00
parent fbdb357823
commit 0f51dc026e
No known key found for this signature in database
GPG key ID: 69A2DEFD98937BA0
2 changed files with 4 additions and 3 deletions

View file

@ -6,4 +6,5 @@ install:
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
script: script:
- make check-style
- make test - make test

View file

@ -28,7 +28,7 @@ endif
gofmt: gofmt:
ifneq ($(HAS_SERVER),) ifneq ($(HAS_SERVER),)
@echo Running GOFMT @echo Running gomft
@for package in $$(go list ./server/...); do \ @for package in $$(go list ./server/...); do \
echo "Checking "$$package; \ echo "Checking "$$package; \
files=$$(go list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' $$package); \ files=$$(go list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' $$package); \
@ -36,12 +36,12 @@ ifneq ($(HAS_SERVER),)
gofmt_output=$$(gofmt -d -s $$files 2>&1); \ gofmt_output=$$(gofmt -d -s $$files 2>&1); \
if [ "$$gofmt_output" ]; then \ if [ "$$gofmt_output" ]; then \
echo "$$gofmt_output"; \ echo "$$gofmt_output"; \
echo "gofmt failure"; \ echo "Gofmt failure"; \
exit 1; \ exit 1; \
fi; \ fi; \
fi; \ fi; \
done done
@echo "gofmt success"; @echo Gofmt success
endif endif
# server/.depensure ensures the server dependencies are installed # server/.depensure ensures the server dependencies are installed