ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Magic Trailing Commas in isort

Open colin99d opened this issue 1 year ago • 4 comments

This fixes #1200 by adding magic trailing comma support. Looking forward to your feedback!

colin99d avatar Dec 24 '22 19:12 colin99d

Awesome, thank you for this! Will try to review today.

charliermarsh avatar Dec 24 '22 19:12 charliermarsh

In isort this is configurable with the split_on_trailing_comma option. We should do the same.

andersk avatar Dec 24 '22 19:12 andersk

Agreed.

charliermarsh avatar Dec 24 '22 20:12 charliermarsh

I haven't tested but... Awesome!

Jackenmen avatar Dec 24 '22 20:12 Jackenmen

@charliermarsh it looks like this has some weird behavior when importing with as, even if the feature is disabled. I am not sure why. But I will dig in.

colin99d avatar Dec 26 '22 14:12 colin99d

Thank you! Appreciate all the effort and output here :)

I made a few changes (which I think fixed the as handling), but let me know if you have any questions or disagree with any of the choices I made.

charliermarsh avatar Dec 26 '22 14:12 charliermarsh

I love all of them, thanks for the help!!

colin99d avatar Dec 26 '22 14:12 colin99d

@colin99d - Thank you! Grateful for the contribution!

charliermarsh avatar Dec 26 '22 14:12 charliermarsh