.PHONY: help test lint typecheck format check install clean

help:
	@echo "Available targets:"
	@echo "  make install    - Install package with dev dependencies"
	@echo "  make test       - Run all tests"
	@echo "  make lint       - Run ruff linter"
	@echo "  make typecheck  - Run mypy type checker"
	@echo "  make format     - Auto-fix linting issues with ruff"
	@echo "  make check      - Run all quality checks (tests, lint, typecheck)"
	@echo "  make clean      - Remove cache and build artifacts"

install:
	uv pip install -e ".[dev]"

test:
	pytest

test-verbose:
	pytest -v

lint:
	ruff check .

typecheck:
	mypy src/rgltr examples

format:
	ruff check --fix .
	ruff format .

check: test lint typecheck
	@echo "✓ All checks passed!"

clean:
	rm -rf build/
	rm -rf dist/
	rm -rf *.egg-info
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type f -name "*.pyc" -delete
	find . -type d -name .pytest_cache -exec rm -rf {} +
	find . -type d -name .mypy_cache -exec rm -rf {} +
	find . -type d -name .ruff_cache -exec rm -rf {} +
