# List available recipes
default:
    @just --list

# Live documentation server with auto-reload
docs:
    uv sync --group docs
    uv run sphinx-autobuild docs/source docs/build/html --open-browser

# Build documentation once
docs-build:
    uv sync --group docs
    uv run sphinx-build -b html docs/source docs/build/html

# Clean built artifacts
clean:
    rm -rf docs/build/

# Run linting and formatting checks
lint:
    uv sync --group dev
    uv run ruff check .
    uv run ruff format --check .

# Auto-fix linting and formatting
fix:
    uv sync --group dev
    uv run ruff check . --fix
    uv run ruff format .

# Run tests with the project Python version
test:
    uv sync --group test
    uv run pytest -vv

# Run tests against the minimum supported Python version
test-py311:
    UV_PROJECT_ENVIRONMENT=.venv-py311 uv sync --python 3.11 --group test
    UV_PROJECT_ENVIRONMENT=.venv-py311 uv run --python 3.11 pytest tests/ -vv

# Run tests with coverage report
# Keep this recipe aligned with the test-cov job in .gitlab-ci.yml.
test-cov:
    uv sync --group test
    uv run pytest -vv --cov=mater --cov-report=term-missing
