Skip to content

--force-alphabetical-sort breaks --lines-between-types=0 #1972

@rec

Description

@rec

Hello, and thanks for a very useful package!

If I set --force-alphabetical-sort then an extra line is inserted between import and from even if --lines-between-types=0

Start with this test file:

import one
import two
from three import four
from five import six

HELLO = 'world'

Running isort --lines-between-types=0 test_isort.py gets:

import one
import two
from five import six
from three import four

HELLO = 'world'

This has no empty line between import and from as expected.

isort --force-alphabetical-sort --lines-between-types=0 test_isort.py gives:

from five import six
from three import four

import one
import two

HELLO = 'world'

which you will note adds an empty line!


Thanks and have an excellent weekend.

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