.PHONY: help install-dev sync test test-e2e test-cov check lint format type-check clean run

install-dev:
	uv sync --group dev --group test

sync:
	uv sync --group dev --group test

test:
	uv run pytest tests/ -m "not e2e" -v

test-e2e:
	EMAIL_E2E=1 uv run pytest tests/ -v -m e2e

test-cov:
	uv run pytest tests/ -m "not e2e" --cov=src/stallari_email_adapter --cov-report=term-missing -v

lint:
	uv run ruff check src/ tests/

format:
	uv run ruff format src/ tests/

type-check:
	uv run mypy src/stallari_email_adapter

check: lint type-check
	@echo "All quality checks passed!"

run:
	uv run stallari-email-adapter

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