-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Our goal for the next four weeks / August is to make progress on some of the remaining hard problems and close the gap to Black. We're looking for contributors that help us implement the remaining syntaxes (preliminary match statement at this point) and fix black incompatibilities. Please reach out if you're interested in tackling something else.
Syntax support
Our goal is to support formatting of all Python syntax by the end of this iteration. This includes fixing bugs where the formatter changes semantics OR introduces syntax errors.
- Formatter: F-Strings (
FormattedValueandJoinedStr) #5913 - Formatter:
Match(includesMatchCaseandPatterns) #5834 -
nonlocalstatement -
globalstatement - Bytes string formatting #6064
- Formatter: lambda star argument gets removed #5894
- Preserve single
\in raw string literals #5941 - Formatter: Docstrings #6196
- Formatter panic with empty attribute inner comment #6181
Black compatibility
Our goal is to fix some black, what we believe more complicated, Black divergences:
- Formatter: Attribute and call chains "fluent interface" #5343
- Formatter: overlong values without breakpoint are never parenthesized #6271
- Formatter: Comprehension ifs should break if the comprehension breaks #6063
- Formatter: Break quality check before breaking parentheses #6065
- Formatter: Preserve leading empty lines of indented classes and functions #6066
- Formatter: boolean operator should have equal level #6068
Suppression and Pragma comments
Black supports disabling formatting for sections or a single line and implements custom logic to ensure that pragma comments (noqa, type-ignore) are kept to the syntax they applied to. Ruff needs to support these comments as well