.PHONY: test test-verbose test-mysql install hooks lint format clean

test:
	uv run pytest -q

test-verbose:
	uv run pytest -v

# Requires a local MySQL 8+ (user/password: alata/alata) — dialect-sensitive db suite only.
test-mysql:
	DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_USERNAME=alata DB_PASSWORD=alata \
	TEST_DB_NAME=alata_core_test_mysql uv run pytest tests/core/db -q

install:
	uv sync --extra dev --extra mysql --extra sqlite --extra s3
	uv run pre-commit install --install-hooks
	uv run pre-commit install --hook-type pre-push

hooks:
	uv run pre-commit run --all-files

lint:
	uv run ruff check alata/ tests/
	uv run ruff format --check alata/ tests/

format:
	uv run ruff format alata/ tests/
	uv run ruff check --fix alata/ tests/

clean:
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null; true
	find . -type f -name '*.pyc' -delete 2>/dev/null; true
