ruff icon indicating copy to clipboard operation
ruff copied to clipboard

`blank-line-between-methods` (`E301`) & `blank-lines-top-level` (`E302`) - conflicts with formatter on `.pyi` files

Open DetachHead opened this issue 1 year ago • 2 comments

# foo.pyi
class Foo: ...
class Bar: ... # error: Expected 2 blank lines, found 0

when running ruff format on this file, it removes the additional blank lines that E302 expects

DetachHead avatar Feb 19 '24 07:02 DetachHead

Nice find. We should review all the E3* rules and verify that they enforce at most one blank lines for pyi files rather than 2

MichaReiser avatar Feb 19 '24 07:02 MichaReiser

I've also detected E305 blank-lines-after-function-or-class also conflicts

KotlinIsland avatar Feb 20 '24 05:02 KotlinIsland