From 529f1ceb1eda18a8d3ea9ac26debf2ffd18738bd Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Tue, 1 Jul 2025 19:35:41 -0700 Subject: [PATCH] add Makefile --- Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7d8e4bc --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ + +SHELL = /bin/bash +.SHELLFLAGS = -o pipefail -c + +.PHONY: help +help: ## Print info about all commands + @echo "Commands:" + @echo + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[01;32m%-20s\033[0m %s\n", $$1, $$2}' + +.PHONY: build +build: ## Build all executables + go build ./cmd/handlr + +.PHONY: all +all: build + +.PHONY: test +test: ## Run tests + go test ./... + +.PHONY: coverage-html +coverage-html: ## Generate test coverage report and open in browser + go test ./... -coverpkg=./... -coverprofile=test-coverage.out + go tool cover -html=test-coverage.out + +.PHONY: lint +lint: ## Verify code style and run static checks + go vet ./... + test -z $(gofmt -l ./...) + +.PHONY: fmt +fmt: ## Run syntax re-formatting (modify in place) + go fmt ./... + +.PHONY: check +check: ## Compile everything, checking syntax (does not output binaries) + go build ./... + +.env: + if [ ! -f ".env" ]; then cp example.dev.env .env; fi -- 2.51.2