From 5d766bc85d9b00f693822be46fb2ed92a13ee662 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Thu, 7 Nov 2024 13:52:18 -0500 Subject: [PATCH] chore: add `help` Make target --- GNUmakefile | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 8ae770c1..7ad0db6d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -2,37 +2,40 @@ TIMEOUT ?= 30s default: test lint -cleantidy: +cleantidy: ## Tidy go modules @echo "make: tidying Go mods..." @cd tools && go mod tidy && cd .. @cd v2/awsv1shim && go mod tidy && cd ../.. @go mod tidy @echo "make: Go mods tidied" -fmt: +fmt: ## Run gofmt gofmt -s -w ./ -gen: +gen: ## Run generators @echo "make: Running Go generators..." @go generate ./... -golangci-lint: +golangci-lint: ## Run golangci-lint @golangci-lint run ./... @cd v2/awsv1shim && golangci-lint run ./... -importlint: +help: ## Display this help + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-13s\033[0m %s\n", $$1, $$2}' + +importlint: ## Lint imports @impi --local . --scheme stdThirdPartyLocal ./... -lint: golangci-lint importlint +lint: golangci-lint importlint ## Run all linters -semgrep: +semgrep: ## Run semgrep checks @docker run --rm --volume "${PWD}:/src" returntocorp/semgrep semgrep --config .semgrep --no-rewrite-rule-ids -test: +test: ## Run unit tests go test -timeout=$(TIMEOUT) -parallel=4 ./... cd v2/awsv1shim && go test -timeout=$(TIMEOUT) -parallel=4 ./... -tools: +tools: ## Install tools cd tools && go install github.com/golangci/golangci-lint/cmd/golangci-lint cd tools && go install github.com/pavius/impi/cmd/impi @@ -42,8 +45,9 @@ tools: fmt \ gen \ golangci-lint \ + help \ importlint \ lint \ test \ test \ - tools \ \ No newline at end of file + tools \