Skip to content

formatter: wrapping on type hint #8226

@henryiii

Description

@henryiii

The following Black'd (23.*) code:

JSONSerializable: TypeAlias = (
    "str | int | float | bool | None | list | tuple | JSONMapping"
)

is converted by ruff format (0.1.2) into:

JSONSerializable: (
    TypeAlias
) = "str | int | float | bool | None | list | tuple | JSONMapping"

Pretty sure that's not intentional? Wrapping on the type hint looks terrible, IMO. :)

PS: While Black produces the code on the top, it will not rewrite the code on the bottom into the top.

Metadata

Metadata

Assignees

Labels

formatterRelated to the formatter

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions