Skip to content

Formatter produces invalid python code if comment between decorator and PEP695 function #12430

@randolf-scholz

Description

@randolf-scholz

https://play.ruff.rs/dbb2fd6a-2906-4ea2-bd00-4abe59506b00

@decorator
# remark
def foo[S](x: S) -> S: ...

becomes

@decorator
def foo# remark
[S](x: S) -> S: ...

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingformatterRelated to the formatter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions