From 44d328f6966a5081ecb1d66cd2e111ef26fb85bd Mon Sep 17 00:00:00 2001 From: Willem Jiang Date: Wed, 20 Aug 2025 09:51:42 +0800 Subject: [PATCH] fix: polish the makefile to provide help command (#518) --- .gitignore | 1 + Makefile | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 1c457b9..f2341f7 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ conf.yaml .idea/ .langgraph_api/ +.DS_Store # coverage report coverage.xml diff --git a/Makefile b/Makefile index 9feb0f8..37d1d2e 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,29 @@ -.PHONY: lint format install-dev serve test coverage +.PHONY: help lint format install-dev serve test coverage langgraph-dev -install-dev: +help: ## Show this help message + @echo "Deer Flow - Available Make Targets:" + @echo "" + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' + @echo "" + @echo "Usage: make " + +install-dev: ## Install development dependencies uv pip install -e ".[dev]" && uv pip install -e ".[test]" -format: +format: ## Format code using ruff uv run ruff format --config pyproject.toml . -lint: +lint: ## Lint and fix code using ruff uv run ruff check --fix --select I --config pyproject.toml . -serve: +serve: ## Start development server with reload uv run server.py --reload -test: +test: ## Run tests with pytest uv run pytest tests/ -langgraph-dev: +langgraph-dev: ## Start langgraph development server uvx --refresh --from "langgraph-cli[inmem]" --with-editable . --python 3.12 langgraph dev --allow-blocking -coverage: - uv run pytest --cov=src tests/ --cov-report=term-missing --cov-report=xml +coverage: ## Run tests with coverage report + uv run pytest --cov=src tests/ --cov-report=term-missing --cov-report=xml \ No newline at end of file