Skip to content

Add magic trailing comma option#1876

Merged
timothycrosley merged 3 commits intoPyCQA:mainfrom
legau:trailing_comma
May 13, 2022
Merged

Add magic trailing comma option#1876
timothycrosley merged 3 commits intoPyCQA:mainfrom
legau:trailing_comma

Conversation

@legau
Copy link
Copy Markdown
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
Copy Markdown

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
@ghost
Copy link
Copy Markdown

ghost 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 hermetoproject/hermeto 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

3 participants