From 5c67bd06d0c413741d3f995a6a84c40f2fd6d8a5 Mon Sep 17 00:00:00 2001 From: sapcc-bot Date: Thu, 6 Feb 2025 18:05:43 +0000 Subject: [PATCH] Run go-makefile-maker --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3ca2d3b..e5e67cb 100644 --- a/Makefile +++ b/Makefile @@ -17,14 +17,17 @@ endif default: build-all +install-goimports: FORCE + @if ! hash goimports 2>/dev/null; then printf "\e[1;36m>> Installing goimports (this may take a while)...\e[0m\n"; go install golang.org/x/tools/cmd/goimports@latest; fi + install-golangci-lint: FORCE @if ! hash golangci-lint 2>/dev/null; then printf "\e[1;36m>> Installing golangci-lint (this may take a while)...\e[0m\n"; go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; fi install-go-licence-detector: FORCE - @if ! hash go-licence-detector 2>/dev/null; then printf "\e[1;36m>> Installing go-licence-detector...\e[0m\n"; go install go.elastic.co/go-licence-detector@latest; fi + @if ! hash go-licence-detector 2>/dev/null; then printf "\e[1;36m>> Installing go-licence-detector (this may take a while)...\e[0m\n"; go install go.elastic.co/go-licence-detector@latest; fi install-addlicense: FORCE - @if ! hash addlicense 2>/dev/null; then printf "\e[1;36m>> Installing addlicense...\e[0m\n"; go install github.com/google/addlicense@latest; fi + @if ! hash addlicense 2>/dev/null; then printf "\e[1;36m>> Installing addlicense (this may take a while)...\e[0m\n"; go install github.com/google/addlicense@latest; fi prepare-static-check: FORCE install-golangci-lint install-go-licence-detector install-addlicense @@ -112,7 +115,7 @@ check-dependency-licenses: FORCE install-go-licence-detector @printf "\e[1;36m>> go-licence-detector\e[0m\n" @go list -m -mod=readonly -json all | go-licence-detector -includeIndirect -rules .license-scan-rules.json -overrides .license-scan-overrides.jsonl -goimports: FORCE +goimports: FORCE install-goimports @printf "\e[1;36m>> goimports -w -local https://github.com/sapcc/http-keep-alive-monitor\e[0m\n" @goimports -w -local github.com/sapcc/http-keep-alive-monitor $(patsubst $(shell awk '$$1 == "module" {print $$2}' go.mod)%,.%/*.go,$(shell go list ./...)) @@ -141,6 +144,7 @@ help: FORCE @printf " \e[36mhelp\e[0m Display this help.\n" @printf "\n" @printf "\e[1mPrepare\e[0m\n" + @printf " \e[36minstall-goimports\e[0m Install goimports required by goimports/static-check\n" @printf " \e[36minstall-golangci-lint\e[0m Install golangci-lint required by run-golangci-lint/static-check\n" @printf " \e[36minstall-go-licence-detector\e[0m Install-go-licence-detector required by check-dependency-licenses/static-check\n" @printf " \e[36minstall-addlicense\e[0m Install addlicense required by check-license-headers/license-headers/static-check\n"