Add govet target
This commit is contained in:
parent
0f51dc026e
commit
1495c46ae6
1 changed files with 11 additions and 2 deletions
13
Makefile
13
Makefile
|
@ -19,16 +19,17 @@ apply:
|
||||||
./build/bin/manifest apply
|
./build/bin/manifest apply
|
||||||
|
|
||||||
.PHONY: check-style
|
.PHONY: check-style
|
||||||
check-style: webapp/.npminstall gofmt
|
check-style: webapp/.npminstall gofmt govet
|
||||||
@echo Checking for style guide compliance
|
@echo Checking for style guide compliance
|
||||||
|
|
||||||
ifneq ($(HAS_WEBAPP),)
|
ifneq ($(HAS_WEBAPP),)
|
||||||
cd webapp && npm run lint
|
cd webapp && npm run lint
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
.PHONY: gofmt
|
||||||
gofmt:
|
gofmt:
|
||||||
ifneq ($(HAS_SERVER),)
|
ifneq ($(HAS_SERVER),)
|
||||||
@echo Running gomft
|
@echo Running gofmt
|
||||||
@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); \
|
||||||
|
@ -44,6 +45,14 @@ ifneq ($(HAS_SERVER),)
|
||||||
@echo Gofmt success
|
@echo Gofmt success
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
.PHONY: govet
|
||||||
|
govet:
|
||||||
|
ifneq ($(HAS_SERVER),)
|
||||||
|
@echo Running govet
|
||||||
|
@$(GO) vet $$(go list ./server/...) || exit 1
|
||||||
|
@echo Govet success
|
||||||
|
endif
|
||||||
|
|
||||||
# server/.depensure ensures the server dependencies are installed
|
# server/.depensure ensures the server dependencies are installed
|
||||||
server/.depensure:
|
server/.depensure:
|
||||||
ifneq ($(HAS_SERVER),)
|
ifneq ($(HAS_SERVER),)
|
||||||
|
|
Reference in a new issue