-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Ruff 2025 style guide #13371
Comments
If anyone's interested in picking up one item on this list, let me know :) Happy to help |
One open question is whether we want to support multiple formatter edition (or at least one old edition). It took the community a long time to upgrade to Ruff 0.2 |
Hey @MichaReiser I'd be interested in picking up #11216. Let me know if this is alright. Thanks! |
Sure. Feel free to give it a go. I don't know what changes are necessary for it but feel free to comment on that issue with ideas or go ahead with a PR and we can discuss there. |
This comment was marked as outdated.
This comment was marked as outdated.
@dhruvmanila, do you remember what the open decisions were on the f-string formatting and what the remaining work is for it to be stabilized? Do you know if black implemented a similar formatting style? |
|
Regarding f-string formatting. We should look into whether it plays nicely with
From looking at the |
Black's plan is to stabilize all preview styles, but none of the unstable features which aligns with what I outlined in the summary. psf/black#4501 |
Are there any plans to incorporate allowing empty new lines after certain code blocks from #9745 ? |
No, allowing empty lines after clause header is not planned for the upcoming style guide |
The [Ruff Formatter](https://docs.astral.sh/ruff/formatter/) is an extremely fast Python code formatter designed as a drop-in replacement for Black. This leads to some adjustments as ruff already contains 2025 black style updates, see astral-sh/ruff#13371
I'm late for this issue, can we have a stable output of https://docs.astral.sh/ruff/formatter/black/#call-expressions-with-a-single-multiline-string-argument ? If it's too late for stable 2025 style, is it possible to be a preview style? |
I'm not sure I understand what you mean. The feature itself is stable since last year. Please open a new issue if it isn't working for you together with an example. |
…1892) The [Ruff Formatter](https://docs.astral.sh/ruff/formatter/) is an extremely fast Python code formatter designed as a drop-in replacement for Black. This leads to some adjustments as ruff already contains 2025 black style updates, see astral-sh/ruff#13371 Co-authored-by: Nikhil Parasaram <nikhilparasaram@gmail.com>
From Black's changelog. Last checked 16.09.2024, Last release: v24.8.0.
Goals:
Preview Styles
Black preview styles
remove_redundant_guard_parens
Parenthesizematch..case
if
guards #13513parens_for_long_if_clauses_in_case_block
(related toremove_redundant_guard_parens
): See #10969 Parenthesizematch..case
if
guards #13513no_normalize_fmt_skip_whitespace
: Don't normalize leading whitespace beforefmt: skip
comments.Black unstable styles
hug_parens_with_braces_and_square_brackets
]hug_parens_with_braces_and_square_brackets
and generators #11375: We decided not to support this style for now because it introduces new parentheses.wrap_long_dict_values_in_parens
non goal. Maybe a simplified version of it that only joins implicitly concatenated stringsmultiline_string_handling
Ruff preview styles
Ruff specific preview styles that we may want to stabilize
f_string_formatting
(style improvement)target-version
ispy312
#13237ruff
] Formatting hex codes changes output with f-string debug #14766comprehension_leading_expression_comments_same_line
(bugfix)with_single_item_pre_39_enabled
(style improvement)f_string_implicit_concatenated_string_literal_quotes
(bugfix)Ruff improvements
remove_redundant_guard_parens
andparens_for_long_if_clauses_in_case_block
Open Bugs
Existing bugs in the ruff formatter for which no preview style exists.
Require a new style guide
Bug fixes that change how existing code is formatted and require a
dynamic
Bug fixes that don't change existing formatting
Bug fixes that don't require a new style guide because they don't change existing cod
;
fmt:skip
to suppress compound statementsBlack Bug fixes
Black preview styles that are related to Black-specific bug fixes. Ruff already handles those cases correctly
pep646_typed_star_arg_type_var_tuple
unify_docstring_detection
: Format module and single quoted docstringstyped_params_trailing_comma
is_simple_lookup_for_doublestar_expression
docstring_check_for_newline
pep646_typed_star_arg_type_var_tuple
Needs fixing
if
expression inside it #14778The text was updated successfully, but these errors were encountered: