# mcgyvr task entrypoints — the single documented way in.
#   make setup     install dependencies (frozen against uv.lock)
#   make test      run the test suite
#   make lint      ruff check + format check
#   make typecheck mypy (strict)
#   make docs      regenerate the generated docs (config reference, /mcgyvr skill)
#   make check     everything CI runs
# uv provides the interpreter and a reproducible, locked dependency set.
.PHONY: setup test lint typecheck docs docs-check check

setup:  ## install dependencies (frozen — resolved from uv.lock)
	# The project itself is rebuilt every time: its version is read from git
	# (hatch-vcs), and an editable install that was not rebuilt reports the
	# commit it was last built at, not HEAD — `mcgyvr --version` on a checkout
	# would name the wrong code.
	uv sync --frozen --reinstall-package mcgyvr

test: setup  ## run the test suite
	uv run --no-sync pytest

lint: setup  ## lint and format check
	uv run --no-sync ruff check .
	uv run --no-sync ruff format --check .

typecheck: setup  ## strict type checking
	uv run --no-sync mypy

docs: setup  ## render+check+delete the config reference; regenerate the /mcgyvr skill
	uv run --no-sync python -m mcgyvr.docgen

docs-check: setup  ## fail if the reference does not render or the committed skill drifted
	uv run --no-sync python -m mcgyvr.docgen --check

check: setup  ## everything CI runs — one build, then lint, typecheck, docs-check and test
	uv run --no-sync ruff check .
	uv run --no-sync ruff format --check .
	uv run --no-sync mypy
	uv run --no-sync python -m mcgyvr.docgen --check
	uv run --no-sync pytest
