-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
formatterRelated to the formatterRelated to the formatterneeds-decisionAwaiting a decision from a maintainerAwaiting a decision from a maintainer
Milestone
Description
Reproducible example:
from typing import TypeAlias
MultiColSelector: TypeAlias = (
"slice | range | list[int] | list[str] | list[bool] | Series"
)black leaves this alone, while ruff formats it as follows:
- MultiColSelector: TypeAlias = (
- "slice | range | list[int] | list[str] | list[bool] | Series"
- )
+ MultiColSelector: (
+ TypeAlias
+ ) = "slice | range | list[int] | list[str] | list[bool] | Series"This looks like an undesirable change to me.
In our code base, I worked around this by rewriting the string as a Union of types.
Command: ruff format .
Formatter settings: None
Version: ruff 0.1.2
P.S.: Other than the two minor issues I just reported, the new ruff formatter is working excellently. It has improved formatting in quite a few cases. Thank you for the amazing work!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
formatterRelated to the formatterRelated to the formatterneeds-decisionAwaiting a decision from a maintainerAwaiting a decision from a maintainer