You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
psf/black may be adopting isort for formatting its imports, an experimental PR has been opened for this purpose, see psf/black#2941.
On opening this PR, we saw one buggy formatting when the sticky comment was attached to a "group" of imports. Since isort gives sticky comments above imports special meaning, it only assumed that the comment was sticking to the first line of the import where as it was sticking to the full group.
Now, isort only maps the comment to the first line of the group i.e. from blib2to3.pytree ... and keeps it alone in the separate group, thus merging the rest into the first party import group.
There isn't a 100% correct solution to this, as not everyone has the same intention when they add comments at the start of the group, it may be for the group as a whole or just the first line of it. But I think the former would be what most cases correspond to. I am not sure how you would go about this or it would be better to leave it as it is.
The problem is currently there are no ways to work this around, so we would need to remove the comment entirely.
Secondly, here it doesn't stick the comment to the first line at all when it is desirable
I have no idea about Isort internals right now, this is probably my first time setting it up for a project, so bare with me.
P.S. Great project! Isort is a charm 🖤 🤍
The text was updated successfully, but these errors were encountered:
psf/black may be adopting
isort
for formatting its imports, an experimental PR has been opened for this purpose, see psf/black#2941.On opening this PR, we saw one buggy formatting when the sticky comment was attached to a "group" of imports. Since isort gives sticky comments above imports special meaning, it only assumed that the comment was sticking to the first line of the import where as it was sticking to the full group.
Now,
isort
only maps the comment to the first line of the group i.e.from blib2to3.pytree ...
and keeps it alone in the separate group, thus merging the rest into the first party import group.There isn't a 100% correct solution to this, as not everyone has the same intention when they add comments at the start of the group, it may be for the group as a whole or just the first line of it. But I think the former would be what most cases correspond to. I am not sure how you would go about this or it would be better to leave it as it is.
The problem is currently there are no ways to work this around, so we would need to remove the comment entirely.
Secondly, here it doesn't stick the comment to the first line at all when it is desirable
I have no idea about Isort internals right now, this is probably my first time setting it up for a project, so bare with me.
P.S. Great project! Isort is a charm 🖤 🤍
The text was updated successfully, but these errors were encountered: