.PHONY: lint test validate validate-docker

PYTHON := python3
ifeq ($(wildcard .venv/bin/python),.venv/bin/python)
PYTHON := .venv/bin/python
endif

UV := $(shell command -v uv 2>/dev/null)

lint:
	$(PYTHON) -m ruff check facio --select F401,F841

test:
	$(PYTHON) -m pytest tests/

validate:
	@if [ -n "$(UV)" ]; then \
		$(UV) sync --all-extras; \
	else \
		echo "uv not found; using existing Python environment"; \
	fi
	$(MAKE) lint
	$(MAKE) test

validate-docker:
	$(MAKE) validate
	docker build -t facio-test .
	docker run --rm facio-test status
