.PHONY: help install dev test lint format typecheck check clean build publish

help:
	@echo "SweatStack CLI Development Commands"
	@echo ""
	@echo "  make install     Install the package"
	@echo "  make dev         Install with development dependencies"
	@echo "  make test        Run tests"
	@echo "  make lint        Run linter"
	@echo "  make format      Format code"
	@echo "  make typecheck   Run type checker"
	@echo "  make check       Run all checks (lint, format, typecheck, test)"
	@echo "  make clean       Remove build artifacts"
	@echo "  make build       Build distribution packages"
	@echo "  make publish     Publish to PyPI"

install:
	uv pip install -e .

dev:
	uv pip install -e ".[dev]"

test:
	uv run pytest

lint:
	uv run ruff check .

format:
	uv run ruff format .

typecheck:
	uv run mypy src/sweatstack_cli

check: lint typecheck test
	@echo "All checks passed!"

clean:
	rm -rf dist/ build/ *.egg-info src/*.egg-info
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
	find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
	find . -type d -name .mypy_cache -exec rm -rf {} + 2>/dev/null || true
	find . -type d -name .ruff_cache -exec rm -rf {} + 2>/dev/null || true

build:
	rm -rf dist
	uv build

publish: build
	uvx uv-publish
