Skip to content

Commit bceccac

Browse files
committed
dev: update CLAUDE.md with new commands
1 parent a687eaa commit bceccac

File tree

1 file changed

+33
-27
lines changed

1 file changed

+33
-27
lines changed

CLAUDE.md

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ ruff check .
1212
ruff check --select I --fix .
1313
ruff format .
1414

15+
# Run markdown formatter
16+
mdformat --number docs/index.md docs/installation.md docs/developing-bots.md docs/protocol-api.md docs/contributing.md README.md
17+
1518
# Run type checker
1619
basedpyright
1720
```
@@ -25,7 +28,7 @@ basedpyright
2528
pytest -x
2629

2730
# Run specific test file - stops after first failure
28-
pytest -x tests/test_api_functions.py
31+
pytest -x tests/lua/test_api_functions.py
2932

3033
# Run tests with verbose output - stops after first failure
3134
pytest -vx
@@ -35,42 +38,45 @@ pytest -vx
3538

3639
1. **Always start Balatro first**:
3740

38-
```bash
39-
# Check if game is running
40-
ps aux | grep -E "(Balatro\.app|balatro\.sh)" | grep -v grep
41+
```bash
42+
# Check if game is running
43+
ps aux | grep -E "(Balatro\.app|balatro\.sh)" | grep -v grep
4144

42-
# Start if not running
43-
./balatro.sh > balatro.log 2>&1 & sleep 10 && echo 'Balatro started and ready'
44-
```
45+
# Start if not running
46+
./balatro.sh > balatro.log 2>&1 & sleep 10 && echo 'Balatro started and ready'
47+
```
4548

4649
2. **Monitor game startup**:
4750

48-
```bash
49-
# Check logs for successful mod loading
50-
tail -n 100 balatro.log
51+
```bash
52+
# Check logs for successful mod loading
53+
tail -n 100 balatro.log
5154

52-
# Look for these success indicators:
53-
# - "BalatrobotAPI initialized"
54-
# - "BalatroBot loaded - version X.X.X"
55-
# - "TCP socket created on port 12346"
56-
```
55+
# Look for these success indicators:
56+
# - "BalatrobotAPI initialized"
57+
# - "BalatroBot loaded - version X.X.X"
58+
# - "TCP socket created on port 12346"
59+
```
5760

5861
3. **Common startup issues and fixes**:
59-
- **Game crashes on mod load**: Review full log for Lua stack traces
60-
- **Steam connection warnings**: Can be ignored - game works without Steam in development
61-
- **JSON metadata errors**: Normal for development files (.vscode, .luarc.json) - can be ignored
62+
63+
- **Game crashes on mod load**: Review full log for Lua stack traces
64+
- **Steam connection warnings**: Can be ignored - game works without Steam in development
65+
- **JSON metadata errors**: Normal for development files (.vscode, .luarc.json) - can be ignored
6266

6367
4. **Test execution**:
64-
- **Test suite**: 55 tests covering API functions and TCP communication
65-
- **Execution time**: ~160 seconds (includes game state transitions)
66-
- **Coverage**: API function calls, socket communication, error handling, edge cases
68+
69+
- **Test suite**: 102 tests covering API functions and TCP communication
70+
- **Execution time**: ~210 seconds (includes game state transitions)
71+
- **Coverage**: API function calls, socket communication, error handling, edge cases
6772

6873
5. **Troubleshooting test failures**:
69-
- **Connection timeouts**: Ensure TCP port 12346 is available
70-
- **Game state errors**: Check if game is responsive and not crashed
71-
- **Invalid responses**: Verify mod loaded correctly by checking logs
72-
- **If test/s fail for timeout the reasons is that Balatro crash because there was an error in the Balatro mod (i.e. @balatrobot.lua and @src/lua/ ). The error should be logged in the `balatro.log` file.**
73-
- **Balatro app crashes**: When the Balatro app crashes during testing, **do not run the remaining tests**. The crash usually indicates an issue with the Lua mod code that causes cryptic errors in `balatro.log`. Stop test execution and investigate the crash logs before continuing. Before running the tests again, ALWAYS kill the current Balatro instance running and start it again.
74+
75+
- **Connection timeouts**: Ensure TCP port 12346 is available
76+
- **Game state errors**: Check if game is responsive and not crashed
77+
- **Invalid responses**: Verify mod loaded correctly by checking logs
78+
- **If test/s fail for timeout the reasons is that Balatro crash because there was an error in the Balatro mod (i.e. @balatrobot.lua and @src/lua/ ). The error should be logged in the `balatro.log` file.**
79+
- **Balatro app crashes**: When the Balatro app crashes during testing, **do not run the remaining tests**. The crash usually indicates an issue with the Lua mod code that causes cryptic errors in `balatro.log`. Stop test execution and investigate the crash logs before continuing. Before running the tests again, ALWAYS kill the current Balatro instance running and start it again.
7480

7581
### Documentation
7682

@@ -107,7 +113,7 @@ I keep the old code around for reference.
107113

108114
### Python Code Style (from `.cursor/rules/`)
109115

110-
- Use modern Python 3.12+ syntax with built-in collection types
116+
- Use modern Python 3.13+ syntax with built-in collection types
111117
- Type annotations with pipe operator for unions: `str | int | None`
112118
- Use `type` statement for type aliases
113119
- Google-style docstrings without type information (since type annotations are present)

0 commit comments

Comments
 (0)