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 imports, 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
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:
After formatting:
For reference, the blank line is added by the formatter when the class sits below other statements, like
imports, 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