PyCQA / pycodestyle

Simple Python style checker in one Python file
https://pycodestyle.pycqa.org
Other
5.01k stars 755 forks source link

testing: add a pair of E303 testcases #1215

Closed allisonkarlitskaya closed 9 months ago

allisonkarlitskaya commented 9 months ago

Add two test cases to verify that pycodestyle correctly flags 2 empty lines in non-toplevel contexts, even outside of functions: one for two empty lines between class methods and one for two empty lines in the indented body of an if: statement at toplevel.

The motivation here is to resolve ambiguity about the intended behaviour of this rule. See https://github.com/astral-sh/ruff/pull/8720#issuecomment-1817837253.