Add make check-style to travis
This commit is contained in:
parent
fbdb357823
commit
0f51dc026e
2 changed files with 4 additions and 3 deletions
|
@ -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
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -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
|
||||||
|
|
Reference in a new issue