.PHONY: build clean install dev test lint format help

# Default target
help:
	@echo "SpecOps CLI - Available targets:"
	@echo ""
	@echo "  build       Build the package (using poetry)"
	@echo "  clean       Remove build artifacts"
	@echo "  install     Install the package locally"
	@echo "  dev         Install in development mode"
	@echo "  test        Run tests"
	@echo "  lint        Run linting"
	@echo "  format      Format code"
	@echo ""


# Build using poetry
build:
	poetry build

# Clean build artifacts
clean:
	rm -rf dist/
	rm -rf build/
	rm -rf *.egg-info
	rm -rf src/*.egg-info
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
	find . -type f -name "*.pyc" -delete 2>/dev/null || true

# Install the package
install: build
	pip install dist/*.whl

# Development install
dev:
	pip install -e .

# Run tests
test:
	pytest

# Lint
lint:
	ruff check src/

# Format
format:
	ruff format src/
