.PHONY: format format-check lint typecheck complexity test test-realworld lock-check check check-all

UV_RUN := uv run --frozen
RUFF := $(UV_RUN) ruff
PYLINT := $(UV_RUN) pylint
MYPY := $(UV_RUN) mypy
PYTEST := $(UV_RUN) pytest
XENON := $(UV_RUN) xenon

format:
	$(RUFF) format src tests
	$(RUFF) check --fix src tests

format-check:
	$(RUFF) format --check src tests

lint:
	$(RUFF) check src tests
	$(PYLINT) src tests

typecheck:
	$(MYPY) src tests

complexity:
	$(XENON) --max-absolute B --max-modules B --max-average A src

test:
	$(PYTEST) -m "not integration" --cov=flist_mcp --cov-branch

test-realworld:
	FLIST_MCP_REALWORLD=1 $(PYTEST) -m integration

lock-check:
	uv lock --check

check: lock-check format-check lint typecheck complexity test

check-all: check test-realworld
