-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
formatterRelated to the formatterRelated to the formatterhelp wantedContributions especially welcomeContributions especially welcome
Milestone
Description
This task coordinates the work on implementing formatting for the Python syntax.
Please create an issue and comment that you intend to work on before starting a new syntax. This allows us to better coordinate the work.
Module
-
Module(includesTypeIgnore) #4800 - Formatter:
Interactive - Formatter:
ExpressionFormatModExpression#5689 - Formatter:
FunctionType
Note: Our infrastructure only supports testing
Module. We should, therefore, wait to implement the other variants.
Statements
- FunctionDef / AsyncFunctionDef (Includes
Arguments, andArg) #4799 - Formatter:
ClassDef#4955 - Formatter:
Return(Implement StmtReturn #4960) - Formatter:
Delete#5287 - Formatter:
Assign(basic implementation done, missing is wrapping the left hand side like black which is hard) - Formatter:
AugAssignFormat StmtAugAssign #5655 - Formatter:
AnnAssign#5662 - Formatter:
For/AsyncFor#5288 - Formatter:
While#4806 - Formatter:
IfStatement #4956 - Formatter:
With/AsyncWith(includesWithItem) #5368 - Formatter:
Match(includesMatchCaseandPatterns) #5834 - Format
raisestatement #5595 - Formatter:
Try/TryStar(includesExceptHandler) #5245 - Formatter:
Assert(Formatassertstatement #5168) - Formatter:
ImportFormat import statements #5493 - Formatter:
ImportFrom(includesAlias) Format import statements #5493 - Formatter:
GlobalAddglobalandnonlocalformatting #6170 (deviation from black: break over multiple lines if it exceeds the line-width Line too long: Multi-line global psf/black#1357) - Formatter:
NonlocalAddglobalandnonlocalformatting #6170 (deviation from black: break over multiple lines if it exceeds the line-width Line too long: Multi-line global psf/black#1357) - Formatter:
ExprFormat StmtExpr #4788 - Formatter:
Pass(Implement StmtPass #4959) - Formatter:
Break - Formatter:
Continue - Formatter:
TypeAlias#5929 (Add formatting of type parameters in class and function definitions #6161, Add formatting of type alias statements #6162)
Expressions
- Formatter:
BoolOp#4962 - Formatter:
NamedExprFormat assignment expressions (FormatExprNamedExpr) #5613 - Formatter:
BinOp(hard) #4896 - Formatter:
UnaryOp#5216 - Formatter:
Lambda#5826 - Formatter:
IfExpFormat ExprIfExp (ternary operator) #5597 - Formatter:
Dict#5206 - Formatter:
Set - format ExprListComp #5600
- Formatter:
SetComp(depends onListComp) #5674 - Formatter:
DictComp(depends onListComp) #5778 - Formatter:
GeneratorExp(depends onListComp) #5676 - Formatter:
Await - Formatter:
Yield/YieldFrom(good first issue) #5916 - Formatter:
Compare#5242 - Formatter:
Call(Format call expressions (without call chaining) #5341, Formatter: Attribute and call chains "fluent interface" #5343) - Formatter: F-Strings (
FormattedValueandJoinedStr) #5913 - Formatter:
Constant(Add basic Constant formatting #4954)- String constant formatting #5294
- Bytes string formatting #6064 (Format bytes string #6166)
- Tuple constant formatting
- Float constant formatting Format numeric constants #5972
- Int constant formatting Format numeric constants #5972
- Complex constant formatting Format numeric constants #5972
- Bool constant (good first issue)
- Ellipsis constant (good first issue)
- None constant (good first issue)
- Formatter:
Attribute#5257 (Formatter: Attribute and call chains "fluent interface" #5343) - Formatter:
Subscript#5286 - Formatter:
Starred#5650 - Formatter:
Name#4802 - Formatter:
List(Format binary expressions #4862) - Formatter:
Tuple(Format ExprTuple #4963) - Formatter:
Slice(Format Slice Expressions #5047)
Improvements
- Remove parentheses from tuples in comprehension target #5779
- Comment placement of expressions with keywords #5780
- Remove unnecessary walrus operator parentheses #5781
Cross-cutting
- Formatter: Parenthesized expressions #5671
- Formatter:
JoinNodesBuilder#4801 - Formatter: Docstrings #6196
- Formatter: Suppression comments #5336
- Formatter: Pragma comments #6197
- Introduce
SuiteStatement#5326 - Decide on trailing comments formatting stop having end-of-line comments expand parent #5353
Bugs
See open issues
Notes
#4730 removed the prototype from @charliermarsh. It's worth taking a look at it when implementing new formatting because it already formatted a lot of syntaxes correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
formatterRelated to the formatterRelated to the formatterhelp wantedContributions especially welcomeContributions especially welcome