-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (62 loc) · 3.1 KB
/
Makefile
File metadata and controls
74 lines (62 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.DEFAULT_GOAL := help
.PHONY: help install serve lint format typecheck quality test coverage all
# Colors (ANSI)
YELLOW := \033[33m
GREEN := \033[32m
BLUE := \033[34m
RED := \033[31m
RESET := \033[0m
# Print helper
PRINT = printf "%b\n"
help: ## Show this help message
@$(PRINT) "$(BLUE)BalatroBench Development Makefile$(RESET)"
@$(PRINT) ""
@$(PRINT) "$(YELLOW)Available targets:$(RESET)"
@printf " $(GREEN)%-18s$(RESET) %s\n" "help" "Show this help message"
@printf " $(GREEN)%-18s$(RESET) %s\n" "install" "Install balatrobench and all dependencies (Python + npm)"
@printf " $(GREEN)%-18s$(RESET) %s\n" "serve" "Serve the site locally on port 8000"
@printf " $(GREEN)%-18s$(RESET) %s\n" "lint" "Run ruff linter (check only)"
@printf " $(GREEN)%-18s$(RESET) %s\n" "format" "Run formatters (ruff, mdformat, js-beautify)"
@printf " $(GREEN)%-18s$(RESET) %s\n" "typecheck" "Run type checkers (Python and Lua)"
@printf " $(GREEN)%-18s$(RESET) %s\n" "quality" "Run all code quality checks"
@printf " $(GREEN)%-18s$(RESET) %s\n" "test" "Run Python and site test suites"
@printf " $(GREEN)%-18s$(RESET) %s\n" "all" "Run all code quality checks and tests"
@printf " $(GREEN)%-18s$(RESET) %s\n" "coverage" "Run tests with coverage report"
install: ## Install balatrobench and all dependencies (Python + npm)
@$(PRINT) "$(YELLOW)Installing Python dependencies...$(RESET)"
uv sync --group dev --group test
@$(PRINT) "$(YELLOW)Installing npm dependencies...$(RESET)"
npm install
serve: ## Serve the site locally on port 8000
@$(PRINT) "$(YELLOW)Starting local server at http://localhost:8000...$(RESET)"
@(sleep 1 && (open http://localhost:8000 2>/dev/null || xdg-open http://localhost:8000 2>/dev/null)) & \
python3 -m http.server 8000 --directory site
lint: ## Run ruff linter (check only)
@$(PRINT) "$(YELLOW)Running ruff linter...$(RESET)"
ruff check --fix --select I .
ruff check --fix .
format: ## Run formatters (ruff, mdformat, js-beautify)
@$(PRINT) "$(YELLOW)Running ruff formatter...$(RESET)"
ruff check --select I --fix .
ruff format .
@$(PRINT) "$(YELLOW)Running mdformat formatter...$(RESET)"
mdformat README.md CLAUDE.md CONTRIBUTING.md
@$(PRINT) "$(YELLOW)Running js-beautify formatter...$(RESET)"
html-beautify --replace --editorconfig site/*.html
js-beautify --replace --editorconfig site/*.js
js-beautify --replace --editorconfig site/benchmarks/**/*.json
typecheck: ## Run type checkers (Python and Lua)
@$(PRINT) "$(YELLOW)Running Python type checker...$(RESET)"
@ty check
quality: lint typecheck format ## Run all code quality checks
@$(PRINT) "$(GREEN)✓ All checks completed$(RESET)"
test: ## Run Python and site test suites
@$(PRINT) "$(YELLOW)Running balatrobench tests...$(RESET)"
@pytest
@$(PRINT) "$(YELLOW)Running site tests...$(RESET)"
@npm test
coverage: ## Run tests with coverage report
@$(PRINT) "$(YELLOW)Running tests with coverage...$(RESET)"
@pytest --cov=balatrobench --cov-report=term-missing --cov-report=html
all: lint format typecheck test ## Run all code quality checks and tests
@$(PRINT) "$(GREEN)✓ All checks completed$(RESET)"