Skip to content

Commit e7e5696

Browse files
build(go.mod): upgrade to go 1.24.0 in order to take advantage of the new tooling mechanism
1 parent c18b2c6 commit e7e5696

File tree

4 files changed

+1341
-33
lines changed

4 files changed

+1341
-33
lines changed

Makefile

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,13 @@ config:
5050
@$(CONFIG_SCRIPT)
5151

5252
.PHONY: all
53-
all: config dependencies tidy fmt vet staticcheck gosec semgrep imports test build install ## Run EVERYTHING!
54-
55-
# Update CI tools used by ./.github/workflows/pr_test.yml
56-
.PHONY: dependencies
57-
dependencies:
58-
@while read -r line || [ -n "$$line" ]; do \
59-
$(GO_BIN) install $$line; \
60-
done < .github/dependencies.txt
61-
@if [ "$$(uname)" = 'Darwin' ]; then \
62-
if ! command -v semgrep &> /dev/null; then \
63-
brew install semgrep; \
64-
fi \
65-
fi
53+
all: config mod-download tidy fmt vet staticcheck gosec semgrep imports test build install ## Run EVERYTHING!
54+
55+
## Downloads the Go modules
56+
mod-download:
57+
@echo "==> Downloading Go module"
58+
@$(GO_BIN) mod download
59+
.PHONY: mod-download
6660

6761
# Clean up Go modules file.
6862
.PHONY: tidy
@@ -97,6 +91,11 @@ nilaway: ## Run nilaway
9791
# NOTE: We can only exclude the import-text-template rule via a semgrep CLI flag
9892
.PHONY: semgrep
9993
semgrep: ## Run semgrep
94+
@if [ "$$(uname)" = 'Darwin' ]; then \
95+
if ! command -v semgrep &> /dev/null; then \
96+
brew install semgrep; \
97+
fi \
98+
fi
10099
@if [ '$(SEMGREP_SKIP)' != 'true' ]; then \
101100
if command -v semgrep &> /dev/null; then semgrep ci --config auto --exclude-rule go.lang.security.audit.xss.import-text-template.import-text-template $(SEMGREP_ARGS); fi \
102101
fi
@@ -105,12 +104,12 @@ semgrep: ## Run semgrep
105104
# To ignore lines use: //lint:ignore <CODE> <REASON>
106105
.PHONY: staticcheck
107106
staticcheck: ## Run static analysis
108-
staticcheck ./{cmd,pkg}/...
107+
@$(GO_BIN) tool staticcheck ./{cmd,pkg}/...
109108

110109
# Run imports formatter.
111110
.PHONY: imports
112111
imports:
113-
@echo goimports ./{cmd,pkg}
112+
@echo $(GO_BIN) tool goimports ./{cmd,pkg}
114113
@eval "bash -c 'F=\$$(goimports -l ./{cmd,pkg}) ; if [[ \$$F ]] ; then echo \$$F ; exit 1 ; fi'"
115114

116115
.PHONY: golangci
@@ -144,8 +143,7 @@ scaffold-category:
144143
# e.g. make graph PKG_IMPORT_PATH=github.com/fastly/cli/pkg/commands/kvstoreentry
145144
.PHONY: graph
146145
graph: ## Graph generates a call graph that focuses on the specified package
147-
@$(GO_BIN) install github.com/ofabry/go-callvis@latest 2>/dev/null
148-
go-callvis -file "callvis" -focus "$(PKG_IMPORT_PATH)" ./cmd/fastly/
146+
$(GO_BIN) tool go-callvis -file "callvis" -focus "$(PKG_IMPORT_PATH)" ./cmd/fastly/
149147
@rm callvis.gv
150148

151149
.PHONY: deps-app-update

0 commit comments

Comments
 (0)