Skip to content

lines_before_import is being ignored for files that only contain imports and comments #1964

@robsdedude

Description

@robsdedude
from a import b

as well as

# comment
from a import b

if run with lines_before_imports = 2 they should result in

 
 
from a import b

(ignore the spaces in the empty lines, they are needed for GH to display leading empty lines)

and

# comment


from a import b

respectively, but they don't. If you add any non-import statement to the files (e.g., foo = bar) the output is as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions