PyCharm - Reformat Selected Text but Optimize Imports and MERGE Duplicate Import Sources to Single Import Line
Answered
I love most things in PyCharm. I also love how this forum is not dead - knowledgeable people from JetBrains actually reply. Thanks to you all.
My question
When I CTRL + ALT + SHIFT + L to Reformat selected text, I have "Optimize imports" selected, then hit run.
The Result is this:
from content.utils import slugifier
from .fields import S3DirectField
from .fields import SorlImageField
from .validators import SlugValidator
I would prefer the result to be this:
from content.utils import slugifier
from .fields import S3DirectField, SorlImageField
from .validators import SlugValidator
Please sign in to leave a comment.
Hi,
You need to enable the following in settings:
Nice! Of course. Exactly what I needed. Thank you.