# Minimum acceptable test coverage percentage; `make cover` fails below it.
# Measured coverage is 96% — the gate sits at 90 to allow small dips while
# preventing rot. Raise as coverage improves; never lower.
THRESHOLD := 90

.PHONY: lint test cover audit outdated update

# Vulnerability audit of installed dependencies (seconds; CI runs this on
# every PR).
audit:
	uv run --with pip-audit pip-audit --skip-editable

# List dependencies with newer releases available. Informational.
outdated:
	uv run uv pip list --outdated

# Upgrade all dependencies within pyproject constraints, then prove the
# suite still passes. After this: fix any breakage (AI-assisted works
# well), bump `version` in pyproject.toml, and open a PR — the
# version-bump check enforces the bump.
update:
	uv lock --upgrade
	uv sync --group dev
	$(MAKE) cover

lint:
	uv run ruff check src/ tests/
	uv run ruff format --check src/ tests/

test:
	uv run pytest tests

cover:
	uv run pytest tests --cov=moov_skills --cov-report=term-missing \
		--cov-fail-under=$(THRESHOLD)
