.PHONY: all check lint typecheck format test test-cov clean build publish docs docs-serve

all: check test

check: lint typecheck

lint:
	uv run ruff check
	uv run ruff format --check

typecheck:
	uv run ty check src
	uv run pyrefly check src
	uv run mypy --strict src/letscode

format:
	uv run ruff format src tests
	uv run ruff check src tests --fix
	uv run ruff format src tests

test:
	uv run pytest

test-cov:
	uv run pytest --cov-report=html --cov-report=term

clean:
	rm -rf .pytest_cache .ruff_cache dist build __pycache__ .mypy_cache \
		.coverage htmlcov .coverage.* *.egg-info

build: clean
	uv build

# T76: drive the built wheel from a clean venv (no publish). The
# release-readiness gate — run before tagging.
verify-dist: build
	uv run python scripts/verify_wheel.py

# T77: plugin discovery from non-editable built wheels (core + plugin).
verify-plugin:
	uv run python scripts/verify_plugin.py

publish: build
	uv publish

docs:
	uv run --group docs zensical build --strict

docs-serve:
	uv run --group docs zensical serve
