diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..e8afa77d --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +.PHONY: setup lint test coverage help + +.DEFAULT_GOAL := help + +help: ## Show this help message + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ + awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' + +setup: ## Install dev dependencies and git hooks + uv sync --dev + uv run prek install + +lint: ## Run all pre-commit hooks + uv run prek run --all-files + +test: ## Run tests + uv run pytest + +coverage: ## Run tests with coverage report + uv run pytest --cov=src/bsblan --cov-report=term-missing diff --git a/README.md b/README.md index 48a0fe91..8612070c 100644 --- a/README.md +++ b/README.md @@ -150,9 +150,21 @@ To install all packages, including all development requirements: ```bash npm install -uv sync --dev +make setup ``` +### Makefile Targets + +A `Makefile` is provided for common development tasks. Run `make help` to +see all available targets: + +| Command | Description | +|-----------------|--------------------------------------| +| `make setup` | Install dev dependencies & git hooks | +| `make lint` | Run all pre-commit hooks | +| `make test` | Run tests | +| `make coverage` | Run tests with coverage report | + As this repository uses [prek][prek] (a faster, Rust-based drop-in replacement for pre-commit), all changes are linted and tested with each commit. You can run all checks and tests manually, using the following command: