.DEFAULT_GOAL := test
.PHONY: test lint format coverage complexity ci clean

test:
	python -m pytest tests/ -q

lint:
	python -m ruff check .
	python -m ruff format --check .

format:
	python -m ruff format .

coverage:
	python -m coverage run -m pytest tests/ -q
	python -m coverage report --fail-under=80

complexity:
	python bmad_code_complexity_gate.py .

ci: lint complexity test
	@echo "All CI gates passed"

clean:
	find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
	rm -rf .coverage htmlcov/
