# Makefile for uv + ruff + mypy + deptry
UV := uv
RUFF := ruff
MYPY := mypy
DEPTRY := deptry

.PHONY: full-lint clean-branches

full-lint:
	@echo "Running ruff check and fix..."
	$(UV) run $(RUFF) check . --fix
	@echo "Running mypy..."
	$(UV) run $(MYPY) . --config-file ./pyproject.toml --no-incremental
	@echo "Running deptry..."
	$(UV) run $(DEPTRY) . --config ./pyproject.toml
	@echo "All checks completed!"


clean-branches:
ifeq ($(OS),Windows_NT)
	@git fetch --prune
	@cmd /C "for /f \"tokens=1\" %%i in ('git branch -vv ^| findstr ": gone]"') do git branch -D %%i" || ver > nul
else
	git fetch --prune
	git branch -vv | grep ': gone]' | awk '{print $$1}' | xargs -r git branch -D
endif