You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/dev-loop.mdc
+71-2
Original file line number
Diff line number
Diff line change
@@ -50,9 +50,78 @@ uv run py.test
50
50
51
51
## 6. Final Commit
52
52
53
-
Make a final commit with any linting/typing fixes.
54
-
Use `@git-commits.mdc` for assistance with commit message standards.
53
+
If all tests pass, make your final commit.
55
54
56
55
## Development Loop Guidelines
57
56
58
57
If there are any failures at any step due to your edits, fix them before proceeding to the next step.
58
+
59
+
## Python Code Standards
60
+
61
+
### Docstring Guidelines
62
+
63
+
For `src/**/*.py` files, follow these docstring guidelines:
64
+
65
+
1. **Use reStructuredText format** for all docstrings.
66
+
```python
67
+
"""Short description of the function or class.
68
+
69
+
Detailed description using reStructuredText format.
70
+
71
+
Parameters
72
+
----------
73
+
param1 : type
74
+
Description of param1
75
+
param2 : type
76
+
Description of param2
77
+
78
+
Returns
79
+
-------
80
+
type
81
+
Description of return value
82
+
"""
83
+
```
84
+
85
+
2. **Keep the main description on the first line** after the opening `"""`.
86
+
87
+
3. **Use NumPy docstyle** for parameter and return value documentation.
88
+
89
+
### Doctest Guidelines
90
+
91
+
For doctests in `src/**/*.py` files:
92
+
93
+
1. **Use narrative descriptions** for test sections rather than inline comments:
94
+
```python
95
+
"""Example function.
96
+
97
+
Examples
98
+
--------
99
+
Create an instance:
100
+
101
+
>>> obj = ExampleClass()
102
+
103
+
Verify a property:
104
+
105
+
>>> obj.property
106
+
'expected value'
107
+
"""
108
+
```
109
+
110
+
2. **Move complex examples** to dedicated test files at `tests/examples/<path_to_module>/test_<example>.py` if they require elaborate setup or multiple steps.
111
+
112
+
3. **Utilize pytest fixtures** via `doctest_namespace` for more complex test scenarios:
113
+
```python
114
+
"""Example with fixture.
115
+
116
+
Examples
117
+
--------
118
+
>>> # doctest_namespace contains all pytest fixtures from conftest.py
0 commit comments