Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line-length issue with black profile #1326

Closed
Gricha opened this issue Jul 16, 2020 · 2 comments
Closed

Line-length issue with black profile #1326

Gricha opened this issue Jul 16, 2020 · 2 comments

Comments

@Gricha
Copy link
Contributor

Gricha commented Jul 16, 2020

Hey! Thanks for the release that's more compatible with black, it is awesome! I think I might've hit an interesting issue which I don't know what the right way of proceeding with would be. Consider this file:

from django.db.models.fields.related_descriptors import ForwardOneToOneDescriptor as ForwardOneToOneDescriptor  # noqa: F401

The contents of this file are irrelevant. What you'll see is this line has over 120 length with comment, but under 120 without comment.

If I run black on it: black . -S --line-length=120, it will reformat this import to:

from django.db.models.fields.related_descriptors import (
    ForwardOneToOneDescriptor as ForwardOneToOneDescriptor,
)  # noqa: F401

Which I think would be expected. Then if I isort it with the following configuration:

[settings]
profile = black
line_length = 120

the result will be:

from django.db.models.fields.related_descriptors import ForwardOneToOneDescriptor as ForwardOneToOneDescriptor  # noqa: F401

again.

I'm curious if that's a bug or just misconfiguration. Please let me know if there is any way I can help here!

The version I'm running is 5.1.1

@timothycrosley
Copy link
Member

Hi @Gricha!

I'm glad you're enjoying the new release of isort! I've fixed this issue in the develop branch and plan on making a new patch release tomorrow.

Thanks!

~Timothy

@Gricha
Copy link
Contributor Author

Gricha commented Jul 17, 2020

Thank you @timothycrosley

@Gricha Gricha closed this as completed Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants