PROJECT_NAME := butterrobot CGO_ENABLED := 0 DIST_PATH := ./dist TEST_OPTIONS := -v -failfast -race -cover GOLANGCI_LINT_VERSION := v1.64.5 .DEFAULT_GOAL := help ## help: Display this help message .PHONY: help help: @echo "Available targets:" @grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## / /' | sort ## build: Build project using goreleaser (snapshot) .PHONY: build build: goreleaser build --snapshot --clean ## build-docker: Build Docker image locally via goreleaser .PHONY: build-docker build-docker: goreleaser release --snapshot --clean ## run: Run the server directly via go run .PHONY: run run: CGO_ENABLED=$(CGO_ENABLED) go run ./cmd/$(PROJECT_NAME) ## format: Format code and tidy modules .PHONY: format format: go fmt ./... go mod tidy ## ci-lint: Run golangci-lint (installs if missing) .PHONY: ci-lint ci-lint: @which golangci-lint > /dev/null 2>&1 || go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) golangci-lint run ./... ## lint: Run linters .PHONY: lint lint: ci-lint ## test: Run tests with coverage .PHONY: test test: CGO_ENABLED=1 go test $(TEST_OPTIONS) -timeout 1m ./... ## clean: Remove build artifacts .PHONY: clean clean: rm -rf $(DIST_PATH) go clean -cache