.PHONY: install install-dev run test lint typecheck clean

PYTHON := python3
PIP := pip
SRC := src/
TESTS := tests/

install:
	$(PIP) install -e .

install-dev:
	$(PIP) install -e ".[dev]"
	pre-commit install

run:
	$(PYTHON) -m voice_dictation.cli.headless

test:
	pytest $(TESTS) -v

test-unit:
	pytest $(TESTS)unit/ -v

lint:
	ruff check $(SRC) $(TESTS)
	ruff format --check $(SRC) $(TESTS)

lint-fix:
	ruff check --fix $(SRC) $(TESTS)
	ruff format $(SRC) $(TESTS)

typecheck:
	mypy --strict $(SRC)

check: lint typecheck test

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