Skip to content

Two blank lines after an import should be reduced to one #2020

@WhyNotHugo

Description

@WhyNotHugo

Describe the style change

This applies to the first line of code after the block of imports at the top of the file.

These lines are not changed by black:

from middleman.authentication import validate_oauth_token

logger = logging.getLogger(__name__)

This is changed to the above (makes sense to me):

from middleman.authentication import validate_oauth_token
logger = logging.getLogger(__name__)

However, black does not reformat this:

from middleman.authentication import validate_oauth_token


logger = logging.getLogger(__name__)

This is very annoying since it allows for inconsistency.

Desired style

I think black should reformat that final example to look like the first. As an alternative, it could also always leave two lines. Either one or two lines is fine by me, but only one option should be valid.

Additional context

I think it's that simple.

Metadata

Metadata

Assignees

No one assigned

    Labels

    F: empty linesWasting vertical space efficiently.S: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedT: styleWhat do we want Blackened code to look like?

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions