forked from yakew7/Fair-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 1.44 KB
/
Copy pathMakefile
File metadata and controls
36 lines (26 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Fair Code - contributor task runner. See CONTRIBUTING.md.
# Reproduces locally what CI runs (.github/workflows: audits.yml, lint.yml,
# build-explainers.yml) so you can catch failures before you push.
.DEFAULT_GOAL := help
PY := python3
.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, pytest-cov, pre-commit, ruff)
$(PY) -m pip install -e ".[excel,parquet,proxy,mcp]" pytest pytest-cov pre-commit ruff
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
favicons: ## Regenerate favicon.ico/PNGs and apple-touch-icon.png from logo.svg
$(PY) scripts/generate_favicons.py
lint: ## Enforce the em-dash-free rule + check for broken doc links + ruff (mirrors the lint workflow)
$(PY) scripts/check_em_dash.py
$(PY) scripts/check_broken_links.py
ruff check faircode scripts tests
check: lint test ## Run everything CI runs (lint + full test suite)
@echo "All checks passed."