From b9e57d11e51f14f3870c5c85ca2d180136a9be3b Mon Sep 17 00:00:00 2001 From: Willem-Jan van Rootselaar Date: Wed, 25 Mar 2026 11:55:57 +0100 Subject: [PATCH 1/2] ci: add Makefile for dev setup with prek hooks --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..7e37c263 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +.PHONY: setup lint test coverage + +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 From c59b7ec3327866aa27447d257258b2e7a401cbd2 Mon Sep 17 00:00:00 2001 From: Willem-Jan van Rootselaar Date: Wed, 25 Mar 2026 12:30:16 +0100 Subject: [PATCH 2/2] ci: enhance Makefile with help command and update README for usage instructions --- Makefile | 8 +++++++- README.md | 14 +++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7e37c263..e8afa77d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,10 @@ -.PHONY: setup lint test coverage +.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 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: