Replies: 2 comments 19 replies
-
|
Please upvote this comment if you like the preview style as-is. |
Beta Was this translation helpful? Give feedback.
11 replies
-
|
Please upvote this comment if you would not upgrade your Ruff version if it stabilized this preview style. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion is for getting community feedback on the preview formatting style for method chains.
This style formats method chains like so:
While much of the feedback has been positive, the main hesitation has been around the case where the chain begins with top-level methods called from popular libraries such as
numpy,pandas, andpolars. These result in situations like the following:Speaking only for myself, I am totally fine with this formatting! However, others may disagree, and I can see how this goes somewhat beyond the intended semantics of "object of interest on one line, followed by transformations on successive lines".
For those proposing alternatives, please note that the formatter does not have access to semantic information (e.g. whether some name is bound to a module), so any proposed heuristics must be syntactical or configuration-based.
Check out the documentation for this style for a detailed description of the style, the original issue for some historical context, and the PR implementing this feature for some additional discussion.
Very much looking forward to your feedback!
Beta Was this translation helpful? Give feedback.
All reactions