-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: deviation from black: dict key split to multiline #11857
Comments
I couldn't find this one on the list of known deviations, and this was quite disliked with black IIRC. |
also, |
I can confirm that Ruff formats this differently than Black. Black's behavior is more consistent here in that it always tries to break the right first, before breaking the left. Ruff tries to do the same but I think it doesn't because of Ruff uses ruff/crates/ruff_formatter/src/printer/mod.rs Lines 1289 to 1291 in 5806bc9
Unfortunately, my hope that this would be fixed by #8940 is unjustified. This only changes another small difference. I'll need to take a closer look at this. Ultimately, I think we can only release this in a new minor version because it will break existing formatting. |
thank you for looking into this. maybe it's worth adding it to the list of known deviations? it is a quite common occurance... |
ruff 0.4.8 python 3.10.14 macos 14.5
input:
black==24.4.2:
ruff==0.4.8
The text was updated successfully, but these errors were encountered: