@@ -2,40 +2,45 @@ default: checks fmt lint
22
33PACKAGES =./acceptance/... ./libs/... ./internal/... ./cmd/... ./bundle/... ./experimental/ssh/... .
44
5+ GO_TOOL ?= go tool -modfile=tools/go.mod
56GOTESTSUM_FORMAT ?= pkgname-and-test-fails
6- GOTESTSUM_CMD ?= go tool gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped --jsonfile test-output.json
7+ GOTESTSUM_CMD ?= ${GO_TOOL} gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped --jsonfile test-output.json
78LOCAL_TIMEOUT ?= 30m
89
910
10- lintfull :
11- golangci-lint run --fix
11+ lintfull : ./tools/golangci-lint
12+ ./tools/ golangci-lint run --fix
1213
13- lint :
14- ./tools/lintdiff.py run --fix
14+ lint : ./tools/golangci-lint
15+ ./tools/lintdiff.py ./tools/golangci-lint run --fix
1516
1617tidy :
1718 @# not part of golangci-lint, apparently
1819 go mod tidy
1920
20- lintcheck :
21- golangci-lint run ./...
21+ lintcheck : ./tools/golangci-lint
22+ ./tools/ golangci-lint run ./...
2223
23- fmtfull : tools/yamlfmt
24+ fmtfull : ./tools/golangci-lint ./ tools/yamlfmt
2425 ruff format -n
25- golangci-lint fmt
26+ ./tools/ golangci-lint fmt
2627 ./tools/yamlfmt .
2728
28- fmt : tools/yamlfmt
29+ fmt : ./tools/golangci-lint ./ tools/yamlfmt
2930 ruff format -n
30- ./tools/lintdiff.py fmt
31+ ./tools/lintdiff.py ./tools/golangci-lint fmt
3132 ./tools/yamlfmt .
3233
33- # pre-building yamlfmt because I also want to call it from tests
34- tools/yamlfmt : go.mod
35- go build -o tools/yamlfmt github.com/google/yamlfmt/cmd/yamlfmt
34+ # pre-building yamlfmt because it is invoked from tests and scripts
35+ tools/yamlfmt : tools/ go.mod tools/go.sum
36+ go build -modfile=tools/go.mod - o tools/yamlfmt github.com/google/yamlfmt/cmd/yamlfmt
3637
37- tools/yamlfmt.exe : go.mod
38- go build -o tools/yamlfmt.exe github.com/google/yamlfmt/cmd/yamlfmt
38+ tools/yamlfmt.exe : tools/go.mod tools/go.sum
39+ go build -modfile=tools/go.mod -o tools/yamlfmt.exe github.com/google/yamlfmt/cmd/yamlfmt
40+
41+ # pre-building golangci-lint because it's faster to run pre-built version
42+ tools/golangci-lint : tools/go.mod tools/go.sum
43+ go build -modfile=tools/go.mod -o tools/golangci-lint github.com/golangci/golangci-lint/v2/cmd/golangci-lint
3944
4045ws :
4146 ./tools/validate_whitespace.py
@@ -65,7 +70,7 @@ test-update-aws:
6570test-update-all : test-update test-update-aws
6671
6772slowest :
68- go tool gotestsum tool slowest --jsonfile test-output.json --threshold 1s --num 50
73+ ${GO_TOOL} gotestsum tool slowest --jsonfile test-output.json --threshold 1s --num 50
6974
7075cover :
7176 rm -fr ./acceptance/build/cover/
@@ -102,7 +107,7 @@ schema:
102107docs :
103108 go run ./bundle/docsgen ./bundle/internal/schema ./bundle/docsgen
104109
105- INTEGRATION = go tool gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./acceptance ./integration/..." -- -parallel 4 -timeout=2h
110+ INTEGRATION = go run -modfile=tools/go.mod ./tools/testrunner/main.go ${GO_TOOL} gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./acceptance ./integration/..." -- -parallel 4 -timeout=2h
106111
107112integration :
108113 $(INTEGRATION )
0 commit comments