|
| 1 | +.DEFAULT_GOAL := help |
| 2 | +.PHONY: help install lint format typecheck quality |
| 3 | + |
| 4 | +# Colors (ANSI) |
| 5 | +YELLOW := \033[33m |
| 6 | +GREEN := \033[32m |
| 7 | +BLUE := \033[34m |
| 8 | +RED := \033[31m |
| 9 | +RESET := \033[0m |
| 10 | + |
| 11 | +# Print helper |
| 12 | +PRINT = printf "%b\n" |
| 13 | + |
| 14 | +help: ## Show this help message |
| 15 | + @$(PRINT) "$(BLUE)BalatroBot Development Makefile$(RESET)" |
| 16 | + @$(PRINT) "" |
| 17 | + @$(PRINT) "$(YELLOW)Available targets:$(RESET)" |
| 18 | + @printf " $(GREEN)%-18s$(RESET) %s\n" "help" "Show this help message" |
| 19 | + @printf " $(GREEN)%-18s$(RESET) %s\n" "install" "Install balatrobot and all dependencies (including dev)" |
| 20 | + @printf " $(GREEN)%-18s$(RESET) %s\n" "lint" "Run ruff linter (check only)" |
| 21 | + @printf " $(GREEN)%-18s$(RESET) %s\n" "format" "Run formatters (ruff, mdformat, stylua)" |
| 22 | + @printf " $(GREEN)%-18s$(RESET) %s\n" "typecheck" "Run type checkers (Python and Lua)" |
| 23 | + @printf " $(GREEN)%-18s$(RESET) %s\n" "quality" "Run all code quality checks" |
| 24 | + |
| 25 | +install: ## Install balatrobot and all dependencies (including dev) |
| 26 | + @$(PRINT) "$(YELLOW)Installing all dependencies...$(RESET)" |
| 27 | + uv sync --group dev --group test |
| 28 | + |
| 29 | +lint: ## Run ruff linter (check only) |
| 30 | + @$(PRINT) "$(YELLOW)Running ruff linter...$(RESET)" |
| 31 | + ruff check --fix --select I . |
| 32 | + ruff check --fix . |
| 33 | + |
| 34 | +format: ## Run formatters (ruff, mdformat, stylua) |
| 35 | + @$(PRINT) "$(YELLOW)Running ruff formatter...$(RESET)" |
| 36 | + ruff check --select I --fix . |
| 37 | + ruff format . |
| 38 | + @$(PRINT) "$(YELLOW)Running mdformat formatter...$(RESET)" |
| 39 | + mdformat README.md CLAUDE.md |
| 40 | + |
| 41 | +typecheck: ## Run type checkers (Python and Lua) |
| 42 | + @$(PRINT) "$(YELLOW)Running Python type checker...$(RESET)" |
| 43 | + @ty check |
| 44 | + |
| 45 | +quality: lint typecheck format ## Run all code quality checks |
| 46 | + @$(PRINT) "$(GREEN)✓ All checks completed$(RESET)" |
0 commit comments