Skip to content

Commit e4b87f0

Browse files
add .claude directory (#1740)
1 parent 984950e commit e4b87f0

2 files changed

Lines changed: 48 additions & 1 deletion

File tree

.claude/CLAUDE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# stripe-python
2+
3+
## Testing
4+
5+
- Run all tests: `just test`
6+
- Run a specific test by name: `just test-one test_name`
7+
- Run a specific test file: `just test tests/path/to/test_file.py`
8+
9+
## Formatting & Linting
10+
11+
- Format: `just format` (uses ruff)
12+
- Lint: `just lint` (uses flake8)
13+
- Typecheck: `just typecheck` (uses pyright)
14+
15+
## Key Locations
16+
17+
- HTTP client (request execution, retries, headers): `stripe/_http_client.py`
18+
- Main client class: `stripe/_stripe_client.py`
19+
- Client options/config: `stripe/_client_options.py`
20+
- API requestor (request building, auth): `stripe/_api_requestor.py`
21+
22+
## Generated Code
23+
24+
- Files containing `File generated from our OpenAPI spec` at the top are generated; do not edit. Similarly, any code block starting with `The beginning of the section generated from our OpenAPI spec` is generated and should not be edited directly.
25+
- If something in a generated file/range needs to be updated, add a summary of the change to your report but don't attempt to edit it directly.
26+
- Most files under `stripe/` resource subdirectories (e.g. `stripe/_customer.py`, `stripe/params/`, `stripe/resources/`) are generated.
27+
- The HTTP client layer (`_http_client.py`, `_stripe_client.py`, `_api_requestor.py`, `_client_options.py`) is NOT generated.
28+
29+
## Conventions
30+
31+
- Uses `requests` library by default for sync HTTP, `httpx` for async
32+
- Type hints throughout
33+
- Virtual env managed in `.venv/`; `just` recipes handle setup automatically
34+
- Work is not complete until `just test`, `just lint` and `just typecheck` complete successfully.
35+
- All code must run on all supported Python versions (full list in the test section of @.github/workflows/ci.yml)
36+
37+
### Comments
38+
39+
- Comments MUST only be used to:
40+
1. Document a function
41+
2. Explain the WHY of a piece of code
42+
3. Explain a particularly complicated piece of code
43+
- Comments NEVER should be used to:
44+
1. Say what used to be there. That's no longer relevant!
45+
2. Explain the WHAT of a piece of code (unless it's very non-obvious)
46+
47+
It's ok not to put comments on/in a function if their addition wouldn't meaningfully clarify anything.

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"venv": true
1515
},
1616
// uses default venv name from Makefile
17-
"python.defaultInterpreterPath": "./venv/bin/python",
17+
"python.defaultInterpreterPath": "",
1818

1919
// Formatting
2020
"editor.formatOnSave": true,

0 commit comments

Comments
 (0)