Skip to content

Commit

Permalink
Run go-makefile-maker
Browse files Browse the repository at this point in the history
  • Loading branch information
sapcc-bot committed Feb 6, 2025
1 parent b72e09a commit d48e0ae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -107,7 +110,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/hermes\e[0m\n"
@goimports -w -local github.com/sapcc/hermes $(patsubst $(shell awk '$$1 == "module" {print $$2}' go.mod)%,.%/*.go,$(shell go list ./...))

Expand Down Expand Up @@ -136,6 +139,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"
Expand Down

0 comments on commit d48e0ae

Please sign in to comment.