export UV_PROJECT_ENVIRONMENT := env

clean:
	rm -rf env .coverage .pytest_cache .cache coverage.xml pyunit.xml .ruff_cache .mypy_cache
	find . | grep -E '__pycache__|\.pyc|\.pyo$\' | xargs rm -rf

lint:
	uv run ruff check src/ tests/ config.py
	uv run ruff format --check src/ tests/ config.py

format:
	uv run ruff check --fix src/ tests/ config.py
	uv run ruff format src/ tests/ config.py

types:
	uv run mypy src/ config.py

test:
	uv run pytest tests/unit --ignore=tests/integration

run:
	uv run python dev.py

lock:
	uv lock

local_listener:
	docker build . --target deploy -t moneyhub/generate_attachments
	docker run -d -p 9000:8080 moneyhub/generate_attachments:latest

local_event:
	curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" \
		-d '{"statement_attachment_id": 24601}'
