@@ -22,29 +22,29 @@ include .bingo/Variables.mk
22
22
23
23
.PHONY : release
24
24
release : $(GORELEASER )
25
- @echo " --- release ---"
26
- @$(GORELEASER ) release --rm-dist
25
+ @echo " --- $@ ---"
26
+ @" $( GORELEASER) " release --rm-dist
27
27
28
28
GOOS := $(shell go env GOOS)
29
29
GOARCH := $(shell go env GOARCH)
30
30
BIN := dist/getenvoy_$(GOOS ) _$(GOARCH )
31
31
bin $(BIN ) : $(GORELEASER )
32
- @echo " --- bin ---"
33
- @$(GORELEASER ) build --snapshot --rm-dist
32
+ @echo " --- $@ ---"
33
+ @" $( GORELEASER) " build --snapshot --rm-dist
34
34
35
35
# #@ Unit, Site and End-to-End tests
36
36
37
37
TEST_PACKAGES ?= $(shell go list ./... | grep -v -e github.com/tetratelabs/getenvoy/e2e -e github.com/tetratelabs/getenvoy/site)
38
38
.PHONY : test
39
39
test :
40
- @echo " --- test ---"
40
+ @echo " --- $@ ---"
41
41
@go test $(TEST_PACKAGES )
42
42
43
43
# Site tests check the contents of the site directory
44
44
45
45
.PHONY : test.site
46
46
test.site :
47
- @echo " --- test.site ---"
47
+ @echo " --- $@ ---"
48
48
@go test -v ./site
49
49
50
50
# End-to-end (e2e) tests run against a compiled binary.
@@ -56,36 +56,36 @@ test.site:
56
56
E2E_GETENVOY_BINARY ?= $(BIN )
57
57
.PHONY : e2e
58
58
e2e : $(E2E_GETENVOY_BINARY )
59
- @echo " --- e2e ---"
59
+ @echo " --- $@ ---"
60
60
@go test -parallel 1 -v -failfast ./e2e
61
61
62
62
# #@ Code quality and integrity
63
63
64
64
COVERAGE_PACKAGES ?= $(shell echo $(TEST_PACKAGES ) | tr -s " " ",")
65
65
.PHONY : coverage
66
66
coverage :
67
- @echo " --- coverage ---"
67
+ @echo " --- $@ ---"
68
68
@go test -coverprofile=coverage.txt -covermode=atomic --coverpkg $(COVERAGE_PACKAGES ) $(TEST_PACKAGES )
69
69
@go tool cover -func coverage.txt
70
70
71
71
.PHONY : lint
72
72
lint : $(GOLANGCI_LINT ) $(LICENSER ) $(GORELEASER ) .golangci.yml .goreleaser.yaml # # Run the linters
73
- @echo " --- lint ---"
74
- @$(LICENSER ) verify -r .
75
- @$(GOLANGCI_LINT ) run --timeout 5m --config .golangci.yml ./...
76
- @$(GORELEASER ) check -q
73
+ @echo " --- $@ ---"
74
+ @" $( LICENSER) " verify -r .
75
+ @" $( GOLANGCI_LINT) " run --timeout 5m --config .golangci.yml ./...
76
+ @" $( GORELEASER) " check -q
77
77
78
78
# The goimports tool does not arrange imports in 3 blocks if there are already more than three blocks.
79
79
# To avoid that, before running it, we collapse all imports in one block, then run the formatter.
80
80
.PHONY : format
81
81
format : $(GOIMPORTS ) # # Format all Go code
82
- @echo " --- format ---"
83
- @$(LICENSER ) apply -r " Tetrate"
82
+ @echo " --- $@ ---"
83
+ @" $( LICENSER) " apply -r " Tetrate"
84
84
@find . -type f -name ' *.go' | xargs gofmt -s -w
85
85
@for f in ` find . -name ' *.go' ` ; do \
86
86
awk ' /^import \($$/,/^\)$$/{if($$0=="")next}{print}' $$ f > /tmp/fmt; \
87
87
mv /tmp/fmt $$ f; \
88
- $(GOIMPORTS ) -w -local github.com/tetratelabs/getenvoy $$ f; \
88
+ " $( GOIMPORTS) " -w -local github.com/tetratelabs/getenvoy $$ f; \
89
89
done
90
90
91
91
# Enforce go version matches what's in go.mod when running `make check` assuming the following:
@@ -97,6 +97,7 @@ GO_VERSION := $(shell go version)
97
97
.PHONY : check
98
98
check : # # CI blocks merge until this passes. If this fails, run "make check" locally and commit the difference.
99
99
# case statement because /bin/sh cannot do prefix comparison, awk is awkward and assuming /bin/bash is brittle
100
+ @echo "--- $@ ---"
100
101
@case "$(GO_VERSION)" in $(EXPECTED_GO_VERSION_PREFIX)* ) ;; * ) \
101
102
echo "Expected 'go version' to start with $(EXPECTED_GO_VERSION_PREFIX), but it didn't: $(GO_VERSION)"; \
102
103
exit 1; \
@@ -115,4 +116,4 @@ clean: $(GOLANGCI_LINT) ## Clean all binaries
115
116
@echo " --- $@ ---"
116
117
@rm -rf dist coverage.txt
117
118
@go clean -testcache
118
- @$(GOLANGCI_LINT ) cache clean
119
+ @" $( GOLANGCI_LINT) " cache clean
0 commit comments