Skip to content

Commit 06a9b47

Browse files
author
Adrian Cole
committed
quote more bwplotka/bingo#26
Signed-off-by: Adrian Cole <adrian@tetrate.io>
1 parent 5ba6be4 commit 06a9b47

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

.bingo/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ reference as a variable like `$(GOIMPORTS)`.
1111

1212
This differs slightly from the defaults of the Bingo project:
1313
* ENV variable support is not included as this project only uses `make`
14+
* Quotes more in `Variables.mk` for windows per https://github.com/bwplotka/bingo/issues/26

.bingo/Variables.mk

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,29 @@ GO ?= $(shell which go)
1515
#
1616
#command: $(GOIMPORTS)
1717
# @echo "Running goimports"
18-
# @$(GOIMPORTS) <flags/args..>
18+
# @"$(GOIMPORTS)" <flags/args..>
1919
#
2020
GOIMPORTS := $(GOBIN)/goimports-v0.1.2
2121
$(GOIMPORTS): $(BINGO_DIR)/goimports.mod
2222
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
2323
@echo "(re)installing $(GOBIN)/goimports-v0.1.2"
24-
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=goimports.mod -o=$(GOBIN)/goimports-v0.1.2 "golang.org/x/tools/cmd/goimports"
24+
@cd "$(BINGO_DIR)" && "$(GO)" build -mod=mod -modfile=goimports.mod -o="$(GOBIN)/goimports-v0.1.2" "golang.org/x/tools/cmd/goimports"
2525

2626
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.40.1
2727
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
2828
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
2929
@echo "(re)installing $(GOBIN)/golangci-lint-v1.40.1"
30-
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.40.1 "github.com/golangci/golangci-lint/cmd/golangci-lint"
30+
@cd "$(BINGO_DIR)" && "$(GO)" build -mod=mod -modfile=golangci-lint.mod -o="$(GOBIN)/golangci-lint-v1.40.1" "github.com/golangci/golangci-lint/cmd/golangci-lint"
3131

3232
GORELEASER := $(GOBIN)/goreleaser-v0.166.0
3333
$(GORELEASER): $(BINGO_DIR)/goreleaser.mod
3434
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
3535
@echo "(re)installing $(GOBIN)/goreleaser-v0.166.0"
36-
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=goreleaser.mod -o=$(GOBIN)/goreleaser-v0.166.0 "github.com/goreleaser/goreleaser"
36+
@cd "$(BINGO_DIR)" && "$(GO)" build -mod=mod -modfile=goreleaser.mod -o="$(GOBIN)/goreleaser-v0.166.0" "github.com/goreleaser/goreleaser"
3737

3838
LICENSER := $(GOBIN)/licenser-v0.6.0
3939
$(LICENSER): $(BINGO_DIR)/licenser.mod
4040
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
4141
@echo "(re)installing $(GOBIN)/licenser-v0.6.0"
42-
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=licenser.mod -o=$(GOBIN)/licenser-v0.6.0 "github.com/liamawhite/licenser"
42+
@cd "$(BINGO_DIR)" && "$(GO)" build -mod=mod -modfile=licenser.mod -o="$(GOBIN)/licenser-v0.6.0" "github.com/liamawhite/licenser"
4343

Makefile

+17-16
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,29 @@ include .bingo/Variables.mk
2222

2323
.PHONY: release
2424
release: $(GORELEASER)
25-
@echo "--- release ---"
26-
@$(GORELEASER) release --rm-dist
25+
@echo "--- $@ ---"
26+
@"$(GORELEASER)" release --rm-dist
2727

2828
GOOS := $(shell go env GOOS)
2929
GOARCH := $(shell go env GOARCH)
3030
BIN := dist/getenvoy_$(GOOS)_$(GOARCH)
3131
bin $(BIN): $(GORELEASER)
32-
@echo "--- bin ---"
33-
@$(GORELEASER) build --snapshot --rm-dist
32+
@echo "--- $@ ---"
33+
@"$(GORELEASER)" build --snapshot --rm-dist
3434

3535
##@ Unit, Site and End-to-End tests
3636

3737
TEST_PACKAGES ?= $(shell go list ./... | grep -v -e github.com/tetratelabs/getenvoy/e2e -e github.com/tetratelabs/getenvoy/site)
3838
.PHONY: test
3939
test:
40-
@echo "--- test ---"
40+
@echo "--- $@ ---"
4141
@go test $(TEST_PACKAGES)
4242

4343
# Site tests check the contents of the site directory
4444

4545
.PHONY: test.site
4646
test.site:
47-
@echo "--- test.site ---"
47+
@echo "--- $@ ---"
4848
@go test -v ./site
4949

5050
# End-to-end (e2e) tests run against a compiled binary.
@@ -56,36 +56,36 @@ test.site:
5656
E2E_GETENVOY_BINARY ?= $(BIN)
5757
.PHONY: e2e
5858
e2e: $(E2E_GETENVOY_BINARY)
59-
@echo "--- e2e ---"
59+
@echo "--- $@ ---"
6060
@go test -parallel 1 -v -failfast ./e2e
6161

6262
##@ Code quality and integrity
6363

6464
COVERAGE_PACKAGES ?= $(shell echo $(TEST_PACKAGES)| tr -s " " ",")
6565
.PHONY: coverage
6666
coverage:
67-
@echo "--- coverage ---"
67+
@echo "--- $@ ---"
6868
@go test -coverprofile=coverage.txt -covermode=atomic --coverpkg $(COVERAGE_PACKAGES) $(TEST_PACKAGES)
6969
@go tool cover -func coverage.txt
7070

7171
.PHONY: lint
7272
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
7777

7878
# The goimports tool does not arrange imports in 3 blocks if there are already more than three blocks.
7979
# To avoid that, before running it, we collapse all imports in one block, then run the formatter.
8080
.PHONY: format
8181
format: $(GOIMPORTS) ## Format all Go code
82-
@echo "--- format ---"
83-
@$(LICENSER) apply -r "Tetrate"
82+
@echo "--- $@ ---"
83+
@"$(LICENSER)" apply -r "Tetrate"
8484
@find . -type f -name '*.go' | xargs gofmt -s -w
8585
@for f in `find . -name '*.go'`; do \
8686
awk '/^import \($$/,/^\)$$/{if($$0=="")next}{print}' $$f > /tmp/fmt; \
8787
mv /tmp/fmt $$f; \
88-
$(GOIMPORTS) -w -local github.com/tetratelabs/getenvoy $$f; \
88+
"$(GOIMPORTS)" -w -local github.com/tetratelabs/getenvoy $$f; \
8989
done
9090

9191
# 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)
9797
.PHONY: check
9898
check: ## CI blocks merge until this passes. If this fails, run "make check" locally and commit the difference.
9999
# case statement because /bin/sh cannot do prefix comparison, awk is awkward and assuming /bin/bash is brittle
100+
@echo "--- $@ ---"
100101
@case "$(GO_VERSION)" in $(EXPECTED_GO_VERSION_PREFIX)* ) ;; * ) \
101102
echo "Expected 'go version' to start with $(EXPECTED_GO_VERSION_PREFIX), but it didn't: $(GO_VERSION)"; \
102103
exit 1; \
@@ -115,4 +116,4 @@ clean: $(GOLANGCI_LINT) ## Clean all binaries
115116
@echo "--- $@ ---"
116117
@rm -rf dist coverage.txt
117118
@go clean -testcache
118-
@$(GOLANGCI_LINT) cache clean
119+
@"$(GOLANGCI_LINT)" cache clean

0 commit comments

Comments
 (0)