PY := .venv/bin/python

.PHONY: test lint fmt typecheck diagnose privacy hooks all

test:      ; $(PY) -m pytest
# BOTH commands, as in CI: `ruff check` does not verify formatting, and running
# only it leaves CI red with the local tree green.
lint:      ; $(PY) -m ruff check . && $(PY) -m ruff format --check .
fmt:       ; $(PY) -m ruff format .
typecheck: ; $(PY) -m mypy autosxtract
# Prints what THIS machine can run. Worth more than any log when an extraction
# result surprises you.
diagnose:  ; $(PY) -m autosxtract.cli diagnose
# The only check that prevents a leak rather than merely a red CI.
privacy:   ; $(PY) scripts/privacy_check.py .
hooks:     ; $(PY) -m pre_commit install
all: lint typecheck test privacy
