Skip to content

isort not behaving as expected with vertical hanging indents for multi line output #2385

Open
@funmathis

Description

@funmathis

We have an .isort.cfg file that looks like this.

[settings]
profile=black
default_section=THIRDPARTY
ensure_newline_before_comments=True
filter_files=True
force_grid_wrap=0
include_trailing_comma=True
order_by_type=False
skip=settings,stages
use_parentheses=True

This should take import statements that are over 100 characters (including spaces) and create a vertical hanging indent for the import statement. However, when we use hanging indents, isort is changing them to single line imports that are over 100 characters. We are also using black with the same settings, so it then reverts the changes. This has led to an infinite loop of isort and black fighting one another. Our short term fix is to turn off some of the isort checks and rely on black to do the vertical hanging indent work, but it would be great if isort behaved as expected.

We're using isort==5.11.5. Please disregard if this is fixed in 6

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