Skip to content

Line Length Ignores Comments #2124

Closed as not planned
Closed as not planned

Description

@LoganPrice344

I've been trying to deploy isort to my code repository using the black profile, but when it ran it would merge the comments inside our imports and add them to the same line as the import location which violates the line length significantly.
This is what It looks like initially.

from os.path import (
join,
# this is a really really really really really really really really 
# really really really really really really long comment
getsize,
)

This is what happens after it runs.

from os.path import (  # this is a really really really really really really really really; really really really really really really long comment
    getsize,
    join,
)

Activity

  1. added theissue type on May 3, 2026
  2. DanielNoord commented on Oct 22, 2026

    @DanielNoord
    Member

    See #2645

    In this case there doesn't seem to be a good solution for isort: there is no good way to handle this while handling all edge cases. Since this is only something you'll run into once (when first running isort or when adding the comment) we'll close as won't fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions