.PHONY: sync requirements lint format test coverage pre-commit check

UV := uv

sync:
	$(UV) sync

requirements:
	$(UV) export --format requirements-txt --no-dev --no-hashes --no-header --no-annotate --frozen --output-file requirements.txt

lint:
	$(UV) run ruff check .

format:
	$(UV) run ruff format .

test:
	$(UV) run pytest tests

coverage:
	$(UV) run pytest --cov=src tests
	$(UV) run coverage xml

pre-commit:
	PRE_COMMIT_HOME=.pre-commit-cache $(UV) run pre-commit run --all-files

check: requirements lint format test pre-commit
