1- tools/ts :
2- # ts is a perl script. perl is installed on most linux systems, and in ubuntu Github runners.
3- mkdir -p tools
4- curl -L -o tools/ts https://github.com/pgdr/moreutils/raw/a87889a3bf06fb6be6022b14c152f2f7de608910/ts
5- @echo "96a9504920a81570e0fc5df9c7a8be76b043261d9ed4a702af0238bdbe5ad5ea tools/ts" | sha256sum --check --strict
6- chmod +x tools/ts
1+ .DEFAULT_GOAL := test
72
83.PHONY : test
94test : tools/ts
@@ -27,8 +22,8 @@ short-test:
2722
2823# NB: CI uses the golangci-lint Github action, not this target
2924.PHONY : lint
30- lint :
31- go run github.com /golangci/golangci -lint/v2/cmd/golangci-lint@v2.1.5 run -v
25+ lint : tools/golangci-lint
26+ tools /golangci-lint run -v
3227
3328.PHONY : checks
3429checks : check_tidy check_vuln check_modern
@@ -49,3 +44,21 @@ check_modern:
4944 go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v0.20.0 ./...
5045# non-zero exit status on issues found
5146# nb: modernize is not part of golangci-lint yet - https://github.com/golangci/golangci-lint/issues/686
47+
48+ # Tools targets
49+
50+ tools :
51+ mkdir -p tools
52+
53+ tools/ts : tools
54+ # ts is a perl script. perl is installed on most linux systems, and in Ubuntu Github runners.
55+ curl -L -o tools/ts https://github.com/pgdr/moreutils/raw/a87889a3bf06fb6be6022b14c152f2f7de608910/ts
56+ @echo "96a9504920a81570e0fc5df9c7a8be76b043261d9ed4a702af0238bdbe5ad5ea tools/ts" | sha256sum --check --strict
57+ chmod +x tools/ts
58+
59+ tools/golangci-lint : tools
60+ # Version must be the same as in golangci-lint Github action
61+ # We install golangci-lint as recommended in the docs. See the same docs for a discussion about go run and
62+ # go get -tool alternatives - https://golangci-lint.run/docs/welcome/install/ .
63+ # Delete tools/golangci-lint if this target is updated (may be automated in the future)
64+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b ./tools v2.5.0
0 commit comments