-
Notifications
You must be signed in to change notification settings - Fork 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
Ruff 2024.2 style #9639
Ruff 2024.2 style #9639
Conversation
|
8e7f818
to
073aa7f
Compare
I reviewed the changes introduced by the new style by formatting a few large projects. Most style changes show up infrequently (or even never). The following three changes result in many changes and can be very disruptive when upgrading.
|
9e0a769
to
18dab48
Compare
18dab48
to
f58ca32
Compare
It seems to me that this should be split in two: Ruff should quickly stabilize the features corresponding to the Black 2024 stable style, leaving more time to consider the other more controversial features. Although I’m personally a fan of all three of them, I think maintaining Black compatibility by default is more important for now. |
We discussed this internally and agree with @andersk that we want to keep close compatibility with Black for now. We don't mind shipping improvements that produce small or no diffs when migrating from Black to Ruff (not necessarily the other way around). This includes the following preview changes that Black did not ship
We don't plan on shipping |
f58ca32
to
1718d92
Compare
1718d92
to
368bfc4
Compare
# leading function comment | ||
-def decorated1(): | ||
- ... | ||
+def decorated1(): ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update our test snapshots to pull in the stable black formattings.
368bfc4
to
4166342
Compare
Summary
This PR promotes Ruff's preview formatter styles to stable.
fix_power_op_line_length
prefer_splitting_right_hand_side_of_assignments
parenthesize_long_type_hints
no_blank_line_before_class_docstring
wrap_multiple_context_managers_in_parens
blank_line_after_nested_stub_class
module_docstring_newlines
dummy_implementations
hex_codes_in_unicode_sequences
multiline_string_handling
format_module_docstring
Differences to black:
multiline-string
Black didn't stabilizeis_hug_parens_with_braces_and_square_brackets
hex_codes_in_unicode_sequences
#8678
Test Plan