-
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 undocumented deviation: multi assignment wrapping #7317
Comments
For what it's worth, I think the Ruff formatting is more readable in this example. |
I am reporting all deviations I come across that are not documented. |
Thanks @JonathanPlasse! That’s great and the intended workflow. We’ll collect undocumented deviations, then make decisions on whether to address them or not. |
Thanks for reporting this deviation. This is an intentional deviation that I'm open to discussing and that we forgot to document. Ruff parenthesizes tuples except in a few places, whereas Black strips the parentheses in many places. # Black
def from_user_altitude_range_to_px4_altitude_range():
user_minimal_coordinate, user_maximal_coordinate = (0.0, 0.0, altitude_range[0]), (
0.0,
0.0,
altitude_range[1],
)
(0.0, 0.0, altitude_range[0]), (
0.0,
0.0,
altitude_range[1],
)
assertEquals(0.0, 0.0, altitude_range[0]),
# Ruff
def from_user_altitude_range_to_px4_altitude_range():
user_minimal_coordinate, user_maximal_coordinate = (
(0.0, 0.0, altitude_range[0]),
(
0.0,
0.0,
altitude_range[1],
),
)
(
(0.0, 0.0, altitude_range[0]),
(
0.0,
0.0,
altitude_range[1],
),
)
(assertEquals(0.0, 0.0, altitude_range[0]),) Our reasoning behind requiring the parentheses it otherwise can be very hard to spot that it is a tuple. For example, would you have noticed that the |
We're considering this an intentional deviation. Can be closed once it's documented. |
Black formatting
Ruff formatting
Use Ruff 0.0.289 with line length 100.
The text was updated successfully, but these errors were encountered: