-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formatter collapses overlong assignment's parenthesized value #7067
Comments
Hmm. What's the best implementation here? Would ruff/crates/ruff_python_formatter/src/expression/parentheses.rs Lines 68 to 69 in 577280c
Parenthesize if the expression breaks. But IIUC since Would it make more sense to add conditional logic to consider this when ruff/crates/ruff_python_formatter/src/expression/mod.rs Lines 199 to 206 in 577280c
In order to avoid reaching the ruff/crates/ruff_python_formatter/src/expression/mod.rs Lines 290 to 299 in 577280c
|
Using
|
This is related to #6816 and specifically this "optimisation" ruff/crates/ruff_python_formatter/src/expression/parentheses.rs Lines 38 to 50 in c05e462
My assumptions were:
Which is why I ultimately opted for better performance than using best fit for every constant/identifier (which are very common) |
Closest report I could find is #6271
Line-length: 88
Black Playground
Ruff Playground
The text was updated successfully, but these errors were encountered: