-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blank-line-between-methods
(E301
) & blank-lines-top-level
(E302
) - conflicts with formatter on .pyi
files
#10039
Labels
bug
Something isn't working
help wanted
Contributions especially welcome
preview
Related to preview mode features
Comments
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 |
blank-lines-top-level
(E302
) - conflicts with formatter on .pyi
filesblank-line-between-methods
(E301
) & blank-lines-top-level
(E302
) - conflicts with formatter on .pyi
files
I've also detected E305 blank-lines-after-function-or-class also conflicts |
MichaReiser
added a commit
that referenced
this issue
Mar 5, 2024
…`) (#10098) ## Summary Fixes #10039 The [recommendation for typing stub files](https://typing.readthedocs.io/en/latest/source/stubs.html#blank-lines) is to use **one** blank line to group related definitions and otherwise omit blank lines. The newly added blank line rules (`E3*`) didn't account for typing stub files and enforced two empty lines at the top level and one empty line otherwise, making it impossible to group related definitions. This PR implements the `E3*` rules to: * Not enforce blank lines. The use of blank lines in typing definitions is entirely up to the user. * Allow at most one empty line, including between top level statements. ## Test Plan Added unit tests (It may look odd that many snapshots are empty but the point is that the rule should no longer emit diagnostics)
nkxxll
pushed a commit
to nkxxll/ruff
that referenced
this issue
Mar 10, 2024
…`) (astral-sh#10098) ## Summary Fixes astral-sh#10039 The [recommendation for typing stub files](https://typing.readthedocs.io/en/latest/source/stubs.html#blank-lines) is to use **one** blank line to group related definitions and otherwise omit blank lines. The newly added blank line rules (`E3*`) didn't account for typing stub files and enforced two empty lines at the top level and one empty line otherwise, making it impossible to group related definitions. This PR implements the `E3*` rules to: * Not enforce blank lines. The use of blank lines in typing definitions is entirely up to the user. * Allow at most one empty line, including between top level statements. ## Test Plan Added unit tests (It may look odd that many snapshots are empty but the point is that the rule should no longer emit diagnostics)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
help wanted
Contributions especially welcome
preview
Related to preview mode features
when running
ruff format
on this file, it removes the additional blank lines thatE302
expectsThe text was updated successfully, but these errors were encountered: