Clarify R503 requires terminal returns only when another branch returns a value (#197) - #216
Conversation
R503 previously said every function should end with an explicit return. That conflicted with the narrower intent of R502 and led to requests for bare `return` in procedures whose only possible result is `None`. Scope the terminal-return requirement to functions that may return a value elsewhere, and add a `GOOD` example showing all-`None` procedures do not need a final `return`.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Summary
WalkthroughUpdate R503 documentation to require a terminal explicit return when other paths may return a value, while documenting that implicit ChangesR503 documentation clarification
Possibly related issues
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 18 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (18 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Sorry @buzzybee-df12, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Closes #197
R503 currently says "Don't rely on implicit
None—always return something at the end." This conflicts with the narrower intent expressed by R502 and led to an invalid request to addreturnto an all-Nonehelper.State the rule as:
This retains the safeguard for mixed value/
Nonecontrol-flow while avoiding redundant bare returns for procedures.