Replies: 1 comment 1 reply
-
|
Thanks for the report and the kind words! We currently have a preview style analogous to Black's https://play.ruff.rs/3ec3cb57-d450-4d2d-9b9d-33e9680c4958?secondary=Format I'm not sure I would personally want it to apply to calls as I slightly prefer our current formatting. But I'm interested to hear what others think! |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hi Ruff team 👋
First of all, thanks for Ruff — the formatter is excellent and we’ve been very happy with it overall.
I’d like to propose an optional formatting style for function calls and literals that improves compactness and readability in some cases.
Desired formatting
When a call or literal needs to be wrapped, keep the first argument (or opening literal) on the same line as the outer call:
Instead of the current default formatting:
Motivation
This style:
(append(WeeklyStats(...)))This is especially noticeable in builder-style code and data aggregation pipelines.
Implementation notes
From my understanding, this should be feasible since all required information is already available in the AST. It can be implemented with opt-in configuration option, for example:
}
Happy to help with examples, edge cases, discussion, or coding if useful.
Thanks again for the great work!
Beta Was this translation helpful? Give feedback.
All reactions