When black encounters a trailing comma in the from ... import list, it expands it vertically. Currently, isort --profile=black doesn't do that, which confuses people (including me :)), see #2128.
This PR enables split_on_trailing_comma, which is the default Black's behavior.
I wasn't sure if I should create a new changelog version header, so i omitted it, since that would require deciding whether this is PATCH or MINOR.
What Black does:
$ echo "from x import (a, b, c,)" | black -
from x import (
a,
b,
c,
)
reformatted -
All done! ✨ 🍰 ✨
1 file reformatted.
What isort does currently:
$ echo "from x import (a, b, c,)" | isort --profile=black -
from x import a, b, c
After this change:
$ echo "from x import (a, b, c,)" | isort --profile=black -
from x import (
a,
b,
c,
)
When
black
encounters a trailing comma in thefrom ... import
list, it expands it vertically. Currently,isort --profile=black
doesn't do that, which confuses people (including me :)), see #2128.This PR enables
split_on_trailing_comma
, which is the default Black's behavior.I wasn't sure if I should create a new changelog version header, so i omitted it, since that would require deciding whether this is PATCH or MINOR.
What Black does:
What isort does currently:
After this change: