.PHONY: lint fmt unit ci_unit_lint ci_unit_lint_clean

lint: ## Run code linters
	uv run ruff check airflow_tools tests
	uv run ruff format airflow_tools tests --check

fmt: ## Run code formatters
	uv run ruff check airflow_tools tests --fix
	uv run ruff format airflow_tools tests

unit:
	uv run pytest

docker_fmt:
	docker compose run --rm --entrypoint uv unit-lint run ruff check airflow_tools tests --fix
	docker compose run --rm --entrypoint uv unit-lint run ruff format airflow_tools tests

ci_unit_lint: ci_unit_lint_clean # Run lint and unit tests in CI/CD
	mkdir -p build
	chmod a+w build
	docker compose run --rm unit-lint

ci_unit_lint_clean: # Teardown lint and unit tests in CI/CD
	rm -rf build
