Skip to content
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_after_nested_stub_class: blank line got added after a nested class with ... #4119

Closed
dhruvmanila opened this issue Dec 18, 2023 · 2 comments
Labels
C: preview style Issues with the preview and unstable style. Add the name of the responsible feature in the title. T: bug Something isn't working

Comments

@dhruvmanila
Copy link

Describe the bug

The preview style description says that the blank line won't be added if the body contains only ..., but it seems that Black is adding an empty line nevertheless.

To Reproduce

For example, take this code:

class Top:
    class Nested1: ...
    class Nested2:
        pass

And run it with these arguments:

$ black file.py

The resulting code is:

class Top:
    class Nested1: ...

    class Nested2:
        pass

Expected behavior

There shouldn't be a blank line after Nested1 as it only contains an ellipsis (...).

Environment

  • Black's version: 24.1a1
  • OS and Python version: MacOS/Python 3.11.3

Additional context

For reference, Black playground.

Please correct me if I'm misinterpreting the preview style.

@dhruvmanila dhruvmanila added the T: bug Something isn't working label Dec 18, 2023
@hauntsaninja hauntsaninja added the C: preview style Issues with the preview and unstable style. Add the name of the responsible feature in the title. label Jan 1, 2024
@JelleZijlstra
Copy link
Collaborator

My intuition is that there should be a blank line because there is a nontrivial class after.

@JelleZijlstra
Copy link
Collaborator

Closing per my above comment.

@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: preview style Issues with the preview and unstable style. Add the name of the responsible feature in the title. T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants