Skip to content

Imports that wrap the maximum line length and contain comments are rendered incorrectly #471

@nicoddemus

Description

@nicoddemus

Consider:

from very_long_module_name import SuperLongClassName  #@UnusedImport -- long string of comments which wrap over

Running isort on it using -m4 and forcing the use of parentheses renders this incorrect code:

from very_long_module_name import (
    SuperLongClassName  # @UnusedImport -- long string of comments which wrap over))))

(Note that isort added the ) after the comment, which generated an syntactically invalid file).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions