[CHORE] Implementing ruff rule D213 + misc formatting - #1361
Conversation
Pyright Type CompletenessView the full Project (full
Other symbols referenced but not exported by
Symbols without documentation:
Patch (exported symbols added or changed by this PR): no exported symbol type-completeness changes detected. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1361 +/- ##
=======================================
Coverage 91.76% 91.76%
=======================================
Files 96 96
Lines 5475 5475
Branches 706 706
=======================================
Hits 5024 5024
Misses 327 327
Partials 124 124
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Could we expand this to add #1277? We can just get this rule done across all the files now. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d9fb20d. Configure here.
rule added on a temporary basis @genedan can you help me understand why the PR ruff run isn't catching the D213 violations on unchanged files? the push ruff run shows around 150 violations. while those fixes are quick by themselves, making a change in a couple dozen files will trigger ruff format to fail on all those files. at that point this becomes a humongous PR. let me know if you'd like me to take off D213 (for a later implementation) or go through the ruff format on pretty much the whole repo now |
|
Oh yeah...we need to do 2 things:
The first task touches the remaining Friedland notebooks. Could you take on the first one? Then I could do part 2? This will trigger a large number files that still need to be edited. Maybe it's like 40-50 files but I believe the number of lines changed per file will be quite small, and much more manageable than before. Before that, we can merge this PR after you make just enough edits to get that Ruff check to pass. |
Priyam had a PR fixing those, which I already approved (but didn't merge prior to his abduction). I'd like to wait another day or so to see if that PR reappears. What I don't understand is what's the per-file ignore actually doing presently?
you can check out the ruff format run in the push ruff workflow. it's currently standing at around 4000 lines of log. so say 1000 lines of actual changes. definitely not quite small. i would still recommend a more organic approach at this point in time.
I can fix the 150 or so D213 violations and get the linter to pass. are you okay with the formatter not passing? |
Would you be able to run Ruff format on just these three files?
I made a PR #1364 to give you an idea on what a "bandaid rip" would look like. The majority of the line changes comes from just this one notebook:
If you think that's manageable, we could go for it, but if you want to break it up, there are various approaches. The non-notebook changes isn't too much. Maybe 1 PR for non-notebook, then we spilt up the notebooks and work on those individually? |
i did a few that didn't have format changes
lol, Priyam was working on a fix for this too |


Summary of Changes
adding D213 and addressing in a handful of files
ruff formatting a couple of files
Related GitHub Issue(s)
#1277
AI/LLM Usage
I used the formatter in my IDE to help. I don't think the formatter uses AI.
Additional Context for Reviewers
there are a few spots where the formatter would make the code less readable. so i just use block-ignore to preserve
Submitter's Checklist
[FIX],[FEAT],[DOCS],[TST],[CHORE], or[BRK]).Reviewer's Checklist
Note
Low Risk
Documentation and formatting-only changes with no runtime logic modifications.
Overview
This PR aligns docstrings and a few hot spots with Ruff formatting and enables lint rule
D213, which expects multi-line docstrings to put the summary on the line after the opening""".Across adjustments (
bootstrap,disposal,parallelogram,trend), core modules (base,common,dunders,io,pandas), and one parallelogram test, docstrings are reflowed to that style without changing wording.dunders.pyalso wraps grouped arithmetic helpers and_get_key_unionin# fmt: offblocks so the formatter does not split those expressions.io.pygets minor chain-expression wrapping into_jsonand trivial class-docstring spacing.No API or algorithm changes—only style and lint configuration.
Reviewed by Cursor Bugbot for commit c4a9383. Bugbot is set up for automated code reviews on this repo. Configure here.