@@ -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
9993semgrep : # # 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
107106staticcheck : # # Run static analysis
108- staticcheck ./{cmd,pkg}/...
107+ @ $( GO_BIN ) tool staticcheck ./{cmd,pkg}/...
109108
110109# Run imports formatter.
111110.PHONY : imports
112111imports :
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
146145graph : # # 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