From 32365f7a5d52aa9f0afada4f430509ee328bac3c Mon Sep 17 00:00:00 2001 From: Yojeet <84186427+Circout-sudo@users.noreply.github.com> Date: Sun, 16 Aug 2026 17:11:30 +0200 Subject: [PATCH] Update Makefile Add pytest-cov coverage reporting (informational, not a CI gate) Closes #249 - Add a `test` extra to pyproject.toml (pytest, pytest-cov) - Add a `make coverage` target; `make test` output is unchanged - CI's profiler job now runs with --cov=faircode --cov-report=term-missing No --cov-fail-under is set anywhere, so this can never fail a PR on a coverage threshold - it's visibility only, as requested in the issue. Baseline on this run: 82% overall coverage across faircode/. Weakest spots: figures.py (0%), cli.py (51%), report.py (64%), benchmark.py (72%) - good candidates for a follow-up issue. README coverage badge (mentioned as optional in #249) is not included here since it needs a live coverage service (Codecov/Coveralls) set up by the maintainer first. --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 64d0c96..255b5e9 100644 --- a/Makefile +++ b/Makefile @@ -5,18 +5,21 @@ .DEFAULT_GOAL := help PY := python3 -.PHONY: help setup test build-explainers favicons lint check +.PHONY: help setup test coverage build-explainers favicons lint check help: ## Show the available targets @grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | \ awk 'BEGIN{FS = ":.*?## "}{printf " %-16s %s\n", $$1, $$2}' -setup: ## Install the package plus the dev tools (pytest, pre-commit, ruff) - $(PY) -m pip install -e ".[excel,parquet,proxy]" pytest pre-commit ruff +setup: ## Install the package plus the dev tools (pytest, pytest-cov, pre-commit) + $(PY) -m pip install -e ".[test]" pre-commit test: ## Run the full test suite (mirrors CI) $(PY) -m pytest tests/ -q +coverage: ## Run the full test suite with a faircode/ coverage report (informational only) + $(PY) -m pytest tests/ -q --cov=faircode --cov-report=term-missing + build-explainers: ## Regenerate explainer pages, data.js, sitemap, and OG images (dark + light) $(PY) scripts/build_explainers.py $(PY) scripts/generate_og_images.py