hs-test: added go style targets
- added checkstyle-go and fixstyle-go - comments in stats_fs.go were missing a space Type: make Change-Id: I520acab5ff61eaf9d0ccfd9425bdc41f74559198 Signed-off-by: Adrian Villin <avillin@cisco.com>
This commit is contained in:

committed by
Dave Wallace

parent
7080294116
commit
56387407c3
8
Makefile
8
Makefile
@ -777,6 +777,14 @@ checkstyle-test:
|
|||||||
checkstyle-python:
|
checkstyle-python:
|
||||||
@$(MAKE) -C test checkstyle-python-all
|
@$(MAKE) -C test checkstyle-python-all
|
||||||
|
|
||||||
|
.PHONY: checkstyle-go
|
||||||
|
checkstyle-go:
|
||||||
|
@$(MAKE) -C extras/hs-test checkstyle-go
|
||||||
|
|
||||||
|
.PHONY: fixstyle-go
|
||||||
|
fixstyle-go:
|
||||||
|
@$(MAKE) -C extras/hs-test fixstyle-go
|
||||||
|
|
||||||
.PHONY: checkstyle-all
|
.PHONY: checkstyle-all
|
||||||
checkstyle-all: checkstyle-commit checkstyle checkstyle-python docs-spell
|
checkstyle-all: checkstyle-commit checkstyle checkstyle-python docs-spell
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
export HS_ROOT=$(CURDIR)
|
export HS_ROOT=$(CURDIR)
|
||||||
|
|
||||||
|
# sets WS_ROOT if called from extras/hs-test
|
||||||
|
ifeq ($(WS_ROOT),)
|
||||||
|
export WS_ROOT=$(HS_ROOT)/../..
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(VERBOSE),)
|
ifeq ($(VERBOSE),)
|
||||||
VERBOSE=false
|
VERBOSE=false
|
||||||
endif
|
endif
|
||||||
@ -60,7 +65,8 @@ help:
|
|||||||
@echo " build-cov - coverage build of VPP and Docker images"
|
@echo " build-cov - coverage build of VPP and Docker images"
|
||||||
@echo " build-debug - build test infra (vpp debug image)"
|
@echo " build-debug - build test infra (vpp debug image)"
|
||||||
@echo " build-go - just build golang files"
|
@echo " build-go - just build golang files"
|
||||||
@echo " fixstyle - format .go source files"
|
@echo " checkstyle-go - check style of .go source files"
|
||||||
|
@echo " fixstyle-go - format .go source files"
|
||||||
@echo " list-tests - list all tests"
|
@echo " list-tests - list all tests"
|
||||||
@echo
|
@echo
|
||||||
@echo "make build arguments:"
|
@echo "make build arguments:"
|
||||||
@ -171,7 +177,26 @@ install-deps:
|
|||||||
fi
|
fi
|
||||||
@touch .deps.ok
|
@touch .deps.ok
|
||||||
|
|
||||||
.PHONY: fixstyle
|
.PHONY: checkstyle-go
|
||||||
fixstyle:
|
checkstyle-go:
|
||||||
@gofmt -w .
|
@output=$$(gofmt -d $${WS_ROOT}); \
|
||||||
|
if [ -z "$$output" ]; then \
|
||||||
|
echo "*******************************************************************"; \
|
||||||
|
echo "Checkstyle OK."; \
|
||||||
|
echo "*******************************************************************"; \
|
||||||
|
else \
|
||||||
|
echo "$$output"; \
|
||||||
|
echo "*******************************************************************"; \
|
||||||
|
echo "Checkstyle failed. Use 'make fixstyle-go' or fix errors manually."; \
|
||||||
|
echo "*******************************************************************"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
.PHONY: fixstyle-go
|
||||||
|
fixstyle-go:
|
||||||
|
@echo "Modified files:"
|
||||||
|
@gofmt -w -l $(WS_ROOT)
|
||||||
@go mod tidy
|
@go mod tidy
|
||||||
|
@echo "*******************************************************************"
|
||||||
|
@echo "Fixstyle done."
|
||||||
|
@echo "*******************************************************************"
|
||||||
|
Reference in New Issue
Block a user