How amenable would you be to a sort mode that instead of doing a hanging indent, prefixes with the module?
from example import a, b, c
from example import e, f, g
this would:
That's a cool idea! isort is built to be configurable to fit every user's projects and such a feature would be consistent with this.
Okay neat., thanks! If I have some time I will try and implement this, but I'll comment before I get started, anyone else should feel free to try if they're interested.
btw: force_single_line = 1 appears to have this as a side-effect already, right?
@blueyed, the way I understand the suggestion is that force_single line would, independent of line length limit and size turn the above into:
from example import a
from example import b
from example import c
from example import e
from example import f
from example import g
Whereas the desire here is to still group (comma delimited) the imports together up until the line length is reached, and then create a new line in the same format.
If anyone decides to pick this up in the future, the place to add additional wrap modes is: https://github.com/timothycrosley/isort/blob/develop/isort/wrap_modes.py
Thanks!
~Timothy
If no one is working on this, can I take it up?
@tegkhanna go for it! I appreciate the offer to contribute! If you run into any issues, let me know how I can un-block you.
Thanks!
~Timothy
@timothycrosley Sure :) I will create a pull request soon!
I see this has been merged to develop, so it will be included in the next release?
The README on develop doesn't seem to mention the new wrap mode. I am not sure whether it will be updated once before the release or before this issue is closed.
@jadkik this is merged in develop, and will make its way into the 5.0.0 release.
Thanks!
~Timothy
Most helpful comment
@jadkik this is merged in develop, and will make its way into the 5.0.0 release.
Thanks!
~Timothy