File tree Expand file tree Collapse file tree 1 file changed +5
-23
lines changed Expand file tree Collapse file tree 1 file changed +5
-23
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ GO_FMT := gofmt
77GO_VET := $(GO_CMD ) vet
88
99CDI_PKG := $(shell grep ^module go.mod | sed 's/^module * //g')
10- GO_MODS := $(shell $(GO_CMD ) list ./...)
11- GO_PKGS := $(shell $(GO_CMD ) list ./... | grep -v cmd/ | sed 's:$(CDI_PKG ) :.:g')
1210
1311BINARIES := bin/cdi
1412
@@ -30,27 +28,18 @@ clean: clean-binaries clean-schema
3028test : test-gopkgs test-schema
3129
3230#
33- # targets for running test prior to filing a PR
31+ # validation targets
3432#
3533
3634pre-pr-checks pr-checks : test fmt lint vet
3735
38-
3936fmt format :
40- $(Q ) report=$$($(GO_FMT ) -s -d -w $$(find . -name *.go ) ) ; \
41- if [ -n " $$ report" ]; then \
42- echo " $$ report" ; \
43- exit 1; \
44- fi
37+ $(Q )$(GO_FMT ) -s -d -w -e .
4538
4639lint :
47- $(Q ) status=0; for f in $$ (find . -name \* .go); do \
48- $(GO_LINT ) $$ f || status=1; \
49- done ; \
50- exit $$ status
51-
40+ $(Q )$(GO_LINT ) -set_exit_status ./...
5241vet :
53- $(Q )$(GO_VET ) $( GO_MODS )
42+ $(Q )$(GO_VET ) ./...
5443
5544#
5645# build targets
@@ -78,14 +67,7 @@ clean-schema:
7867
7968# tests for go packages
8069test-gopkgs :
81- $(Q ) status=0; for pkg in $( GO_PKGS) ; do \
82- $(GO_TEST ) $$ pkg; \
83- if [ $$ ? != 0 ]; then \
84- echo " *** Test FAILED for package $$ pkg." ; \
85- status=1; \
86- fi ; \
87- done ; \
88- exit $$ status
70+ $(Q )$(GO_TEST ) ./...
8971
9072# tests for CDI Spec JSON schema
9173test-schema :
You can’t perform that action at this time.
0 commit comments