Skip to content

Commit 8a7a5b4

Browse files
author
sapcc-bot
committed
Run go-makefile-maker
1 parent c5d2c1d commit 8a7a5b4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ endif
1818
default: FORCE
1919
@echo 'There is nothing to build, use `make check` for running the test suite or `make help` for a list of available targets.'
2020

21+
install-goimports: FORCE
22+
@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
23+
2124
install-golangci-lint: FORCE
2225
@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
2326

2427
install-go-licence-detector: FORCE
25-
@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
28+
@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
2629

2730
install-addlicense: FORCE
28-
@if ! hash addlicense 2>/dev/null; then printf "\e[1;36m>> Installing addlicense...\e[0m\n"; go install github.com/google/addlicense@latest; fi
31+
@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
2932

3033
prepare-static-check: FORCE install-golangci-lint install-go-licence-detector install-addlicense
3134

@@ -92,7 +95,7 @@ check-dependency-licenses: FORCE install-go-licence-detector
9295
@printf "\e[1;36m>> go-licence-detector\e[0m\n"
9396
@go list -m -mod=readonly -json all | go-licence-detector -includeIndirect -rules .license-scan-rules.json -overrides .license-scan-overrides.jsonl
9497

95-
goimports: FORCE
98+
goimports: FORCE install-goimports
9699
@printf "\e[1;36m>> goimports -w -local https://github.com/sapcc/gophercloud-sapcc\e[0m\n"
97100
@goimports -w -local github.com/sapcc/gophercloud-sapcc/v2 $(patsubst $(shell awk '$$1 == "module" {print $$2}' go.mod)%,.%/*.go,$(shell go list ./...))
98101

@@ -118,6 +121,7 @@ help: FORCE
118121
@printf " \e[36mhelp\e[0m Display this help.\n"
119122
@printf "\n"
120123
@printf "\e[1mPrepare\e[0m\n"
124+
@printf " \e[36minstall-goimports\e[0m Install goimports required by goimports/static-check\n"
121125
@printf " \e[36minstall-golangci-lint\e[0m Install golangci-lint required by run-golangci-lint/static-check\n"
122126
@printf " \e[36minstall-go-licence-detector\e[0m Install-go-licence-detector required by check-dependency-licenses/static-check\n"
123127
@printf " \e[36minstall-addlicense\e[0m Install addlicense required by check-license-headers/license-headers/static-check\n"

0 commit comments

Comments
 (0)