Skip to content

Commit 0f6c1e6

Browse files
committed
docs: update CLAUDE.md with new make commands
1 parent 02c569f commit 0f6c1e6

File tree

1 file changed

+45
-79
lines changed

1 file changed

+45
-79
lines changed

CLAUDE.md

Lines changed: 45 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,112 +4,78 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Development Commands
66

7-
### Linting and Type Checking
7+
### Quick Start with Makefile
88

9-
```bash
10-
# Run ruff linter and formatter
11-
ruff check .
12-
ruff check --select I --fix .
13-
ruff format .
14-
15-
# Run markdown formatter
16-
mdformat .
17-
18-
# Run type checker
19-
basedpyright
20-
```
21-
22-
### Testing
23-
24-
**IMPORTANT**: Tests require Balatro to be running in the background. Use `./balatro.sh --status` to check if the game is running.
9+
The project includes a comprehensive Makefile with all development workflows. Run `make help` to see all available commands:
2510

2611
```bash
27-
# Run all tests (requires Balatro to be running) - stops after first failure
28-
pytest
12+
# Show all available commands with descriptions
13+
make help
2914

30-
# Run specific test file - stops after first failure
31-
pytest tests/lua/test_api_functions.py
15+
# Quick development workflow (format + lint + typecheck)
16+
make dev
3217

33-
# Run tests with verbose output - stops after first failure
34-
pytest -vx
18+
# Complete workflow including tests
19+
make all
3520

36-
# Run tests on specific port
37-
pytest --port 12347 tests/lua/endpoints/test_cash_out.py
21+
# Install development dependencies
22+
make install-dev
3823
```
3924

40-
#### Parallel Testing with Multiple Balatro Instances
41-
42-
The test suite supports running tests in parallel across multiple Balatro instances. This dramatically reduces test execution time by distributing tests across multiple game instances.
43-
44-
**Setup for Parallel Testing:**
45-
46-
1. **Check existing instances and start multiple Balatro instances on different ports**:
47-
48-
```bash
49-
# First, check if any instances are already running
50-
./balatro.sh --status
51-
52-
# If you need to kill all existing instances first:
53-
./balatro.sh --kill
54-
```
25+
### Code Quality and Linting
5526

56-
```bash
57-
# Start two instances with a single command
58-
./balatro.sh -p 12346 -p 12347
59-
60-
# With performance optimizations for faster testing
61-
./balatro.sh --fast -p 12346
62-
63-
# Headless mode for server environments
64-
./balatro.sh --headless -p 12346
27+
```bash
28+
make lint # Check code with ruff linter
29+
make lint-fix # Auto-fix linting issues
30+
make format # Format code with ruff
31+
make format-md # Format markdown files
32+
make typecheck # Run type checker
33+
make quality # Run all quality checks
34+
```
6535

66-
# Fast Headless mode on 4 instances (recommended configuration)
67-
./balatro.sh --headless --fast -p 12346 -p 12347 -p 12348 -p 12349
68-
```
36+
### Testing
6937

70-
2. **Run tests in parallel**:
38+
```bash
39+
make test # Run tests with single instance (auto-starts if needed)
40+
make test-parallel # Run tests on 4 instances (auto-starts if needed)
41+
make test-teardown # Kill all Balatro instances
42+
make test-verbose # Run tests with verbose output
43+
make coverage # Generate coverage reports
44+
```
7145

72-
```bash
73-
# Two workers (faster than single instance)
74-
pytest -n 4 --port 12346 --port 12347 tests/lua/
46+
**Testing Features:**
7547

76-
# Four workers (maximum parallelization)
77-
pytest -n 4 --port 12346 --port 12347 --port 12348 --port 12349 tests/lua/
78-
```
48+
- **Auto-start**: Both `test` and `test-parallel` automatically start Balatro instances if not running
49+
- **Parallel speedup**: `test-parallel` provides ~4x speedup with 4 workers
50+
- **Instance management**: Tests keep instances running after completion
51+
- **Port isolation**: Each worker uses its dedicated Balatro instance (ports 12346-12349)
7952

80-
**Benefits:**
53+
**Usage:**
8154

82-
- **Faster test execution**: ~4x speedup with 4 parallel workers
83-
- **Port isolation**: Each worker uses its dedicated Balatro instance
55+
- `make test` - Simple single-instance testing (auto-handles everything)
56+
- `make test-parallel` - Fast parallel testing (auto-handles everything)
57+
- `make test-teardown` - Clean up when done testing
8458

8559
**Notes:**
8660

87-
- Each Balatro instance must be running on a different port before starting tests
88-
- Tests automatically distribute across available workers
8961
- Monitor logs for each instance: `tail -f logs/balatro_12346.log`
9062
- Logs are automatically created in the `logs/` directory with format `balatro_PORT.log`
9163

92-
#### Test Prerequisites and Workflow
93-
94-
0. **Check existing instances first**:
64+
### Documentation
9565

9666
```bash
97-
# Check if Balatro instances are already running
98-
./balatro.sh --status
99-
100-
# If instances are running on needed ports, you can proceed with testing
101-
# If you need to kill all running instances and start fresh:
102-
./balatro.sh --kill
67+
make docs-serve # Serve documentation locally
68+
make docs-build # Build documentation
69+
make docs-clean # Clean documentation build
10370
```
10471

105-
### Documentation
72+
### Build and Maintenance
10673

10774
```bash
108-
# Serve documentation locally
109-
mkdocs serve
110-
111-
# Build documentation
112-
mkdocs build
75+
make install # Install package dependencies
76+
make install-dev # Install with development dependencies
77+
make build # Build package for distribution
78+
make clean # Clean all build artifacts and caches
11379
```
11480

11581
## Architecture Overview

0 commit comments

Comments
 (0)