Skip to content

Commit ad64e40

Browse files
authored
Add custom coderabbit instructions (#4)
* Add custom coderabbit instructions
1 parent 84c54dd commit ad64e40

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

.coderabbit.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
inheritance: true
3+
4+
5+
reviews:
6+
sequence_diagrams: true
7+
changed_files_summary: true
8+
labeling_instructions: []
9+
path_filters: []
10+
path_instructions:
11+
- path: "**/*.py"
12+
instructions: |
13+
## pyisolate Core Library Guidelines
14+
15+
- Independence
16+
- While this library is primarily created for use with ComfyUI, it MUST NOT depend on ComfyUI or any of its packages.
17+
- ComfyUI and 'comfy' should ONLY be referenced in the context of documenting the motivation behind certain design decisions (e.g. what we optimize for). The assumption should be that this library could be used for other purposes.
18+
- Code specific to ComfyUI does NOT belong in this repository.
19+
20+
- Documentation
21+
- It is VERY important that this library should be well-documented and usable by people without them understanding internal implementation details.
22+
- Documentation should NEVER include references to internal implementation details unless absolutely necessary for understanding the public API. This includes communication between host and extension processes and environment variables used internally to pass information.
23+
- Identify preconditions or unhandled cases that are lacking documentation.
24+
- Documentation is generated via Sphinx from docstrings. Ensure docstrings use supported Sphinx markup.
25+
- Inline comments should be used when code may be non-obvious.
26+
27+
- Type Hints
28+
- All public functions and classes MUST have complete type hints (enforced by mypy with `disallow_untyped_defs`)
29+
- NEVER use `Any` unless absolutely necessary and justified
30+
- NEVER use `# type: ignore` or cast to `Any` unless absolutely necessary and justified
31+
- Use `TypeVar`, `Generic`, `TypedDict`, `Literal`, `Union` appropriately
32+
33+
- Architecture
34+
- Public API goes in `pyisolate/` root modules (`__init__.py`, `host.py`, `config.py`, `shared.py`)
35+
- Internal implementation goes in `pyisolate/_internal/`
36+
- Maintain zero runtime dependencies - this is a pure Python library
37+
- All RPC-callable methods in ProxiedSingleton subclasses must be `async`
38+
39+
- Error Handling
40+
- Never use empty `except:` or `except Exception:` without re-raising or logging
41+
- Propagate errors with meaningful context across RPC boundaries
42+
- Use specific exception types when possible
43+
44+
- Fail Loudly
45+
- When this library is used incorrectly, it MUST fail loudly with clear error messages or exceptions rather than trying to silently guess what the caller intended.
46+
47+
- Backwards Compatibility
48+
- Changes to the public API MUST be backwards compatible unless the major version is incremented (or the major version is zero and the minor version is incremented).
49+
- If the major version is incremented (or the minor version is incremented when major is zero), backward compatibility of the public API is NOT required, but changes MUST be documented.
50+
- In all cases, changes to the private/internal code does NOT require backward compatibility. Simplicity should be preferred.
51+
- Changes to the RPC protocol do NOT need to be backwards compatible. We can always assume that both the host process and client processes use the exact same version of pyisolate.
52+
53+
- path: "tests/**/*.py"
54+
instructions: |
55+
## Test Guidelines
56+
57+
- Use `pytest` fixtures from `conftest.py`
58+
- Integration tests that create real venvs are slow - mark appropriately
59+
- Mock sparingly - prefer real integration tests where feasible
60+
- Test edge cases and error conditions, not just happy paths
61+
- Assert statements are allowed in tests (`S101` is ignored)
62+
- Print statements are allowed in tests for debugging (`T201` is ignored)
63+
64+
- path: "example/**/*.py"
65+
instructions: |
66+
## Example Code Guidelines
67+
68+
- Examples should be clear and educational
69+
- Comments explaining "why" are encouraged here
70+
- Must actually work - these are tested in CI
71+
- Demonstrate real use cases, not contrived examples
72+
73+
- path: "benchmarks/**/*.py"
74+
instructions: |
75+
## Benchmark Guidelines
76+
77+
- Benchmarks must be reproducible
78+
- Include warm-up iterations to avoid JIT/cache effects
79+
- Report statistical measures (mean, std dev, min, max)
80+
- Document what is being measured and why
81+
- GPU benchmarks should handle CUDA OOM gracefully

0 commit comments

Comments
 (0)