-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
formatterRelated to the formatterRelated to the formattergood first issueGood for newcomersGood for newcomershelp wantedContributions especially welcomeContributions especially welcomestyleHow should formatted code lookHow should formatted code look
Description
Summary
In a stub.pyi
, I expect a blank line before a class (including its decorators) when it's defined below a function.
Before formatting:
def hello(): ...
@lambda _, /: _
class A: ...
After formatting:
def hello(): ...
@lambda _, /: _
class A: ...
For reference, the blank line is added by the formatter when the class sits below other statements, like import
s, assignments, and other classes.
(I couldn't provide a ruff playground link because I couldn't figure out how to make it format a source file like it would do for stubs. Does such an option in the playground exist?)
See psf/black#4256 for reference - the missing blank line isn't intentional, but fixing it in black is apparently not trivial. Is it also not trivial in ruff?
Version
ruff 0.12.0
Metadata
Metadata
Assignees
Labels
formatterRelated to the formatterRelated to the formattergood first issueGood for newcomersGood for newcomershelp wantedContributions especially welcomeContributions especially welcomestyleHow should formatted code lookHow should formatted code look