Skip to content

# noqa for individual imports in an import group are broken off into separate import statements #1004

@ljades

Description

@ljades

My project is noticing a strange behavior with isort and we're wondering if it's intentional design.

Right now, we are configured so that this is a valid import:

from very_long_import_name_close_to_limit import (
    a,
    b,
    c,
)

However, we want to add # noqa to the imports so that flake8 doesn't mark them as unused (for project-specific reasons, we want them to be directly importable from this file). However, doing so results in the following isort fix:

-from very_long_import_name_close_to_limit import (
-    a,  # noqa
-    b,  # noqa
-    c,  # noqa
-)
+from very_long_import_name_close_to_limit import a  # noqa
+from very_long_import_name_close_to_limit import b  # noqa
+from very_long_import_name_close_to_limit import c  # noqa

Is this intentional behavior? If so, why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions