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: .cursorrules
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,12 +44,19 @@ When invoking `swiftc`, pass `-module-cache-path` with a temporary directory to
44
44
45
45
Avoid putting type information in non-type names. Variable names should reflect the role of the value, if at all possible. If you can't find a better name for a variable than one that reflects its type, use a single letter name.
46
46
47
+
Extension property and method names must be clear about what they return. Use gerunds (verbs ending in -ing) for transformations (e.g., `normalizingLineEndings()` not `normalizedLineEndings`).
48
+
49
+
Avoid computed properties that aren't O(1). Any operation that scans or transforms the entire collection should be a method, not a property.
50
+
51
+
Only use intermediate variables where they reduce nesting or significantly reduce code size. Variables used only once should be avoided.
52
+
47
53
## Documentation Guidelines
48
54
49
55
- Every declaration outside a function body needs a doc comment except for tests and declarations that satisfy protocol requirements.
50
56
- Capture the complete contract in concise summaries following better-code contracts principles
51
57
- Avoid verbose parameter blocks when good naming and a clear summary suffice
52
58
- Name parameters in summary (e.g., "`nodes`'s text") to show their roles precisely
59
+
- Use `self` rather than "this T" where T is the type of `self` (e.g., "`self` decoded as UTF-8" not "This data decoded as UTF-8")
53
60
- Raise the level of abstraction - focus on semantic meaning rather than implementation details
54
61
- Doc comments describe the contract (what, not how). Implementation details and rationale belong in regular comments inside the function body.
55
62
- When multiple sentences are needed, separate them with a blank line
0 commit comments