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

Add magic trailing comma option #1876

Merged
merged 3 commits into from
May 13, 2022
Merged

Conversation

legau
Copy link
Contributor

@legau legau commented Dec 29, 2021

Resolves #1683, it adds the split_on_trailing_comma option.
There's an ambiguous case when from imports are split into 2 parts like this :

from lib import (a, b, c,)
from lib import d

In this case I made the choice to always make it split whenever one of the from imports has a trailing comma.

The integration test on airflow won't work until apache/airflow#20556 is passed

@legau legau force-pushed the trailing_comma branch 4 times, most recently from 43282b3 to 2ad61b4 Compare December 29, 2021 23:55
@Jackenmen
Copy link

The integration test on airflow won't work until apache/airflow#20556 is passed

It looks like it's been merged now so perhaps you should try rerunning tests now?

@timothycrosley timothycrosley merged commit 72687ec into PyCQA:main May 13, 2022
@0xallie
Copy link

0xallie commented Jul 29, 2022

Any plans on when this is going to be included in a new release?

@legau legau deleted the trailing_comma branch July 29, 2022 10:54
chmeliik added a commit to chmeliik/cachi2 that referenced this pull request Oct 11, 2022
Technically this shouldn't be necessary, because isort aims to be
compatible with black which respects the trailing comma.

But the isort [fix][0] for this is not released yet.

[0]: PyCQA/isort#1876

Signed-off-by: Adam Cmiel <acmiel@redhat.com>
chmeliik added a commit to containerbuildsystem/cachi2 that referenced this pull request Oct 11, 2022
Technically this shouldn't be necessary, because isort aims to be
compatible with black which respects the trailing comma.

But the isort [fix][0] for this is not released yet.

[0]: PyCQA/isort#1876

Signed-off-by: Adam Cmiel <acmiel@redhat.com>
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

Successfully merging this pull request may close these issues.

Support for magic trailing comma
4 participants