PyCQA / isort

A Python utility / library to sort imports.
https://pycqa.github.io/isort/
MIT License
6.53k stars 583 forks source link

Option to add empty line(s) between top-level package imports #2104

Open superlevure opened 1 year ago

superlevure commented 1 year ago

Hi!

I've looked extensively in the documentation but I don't think there's a way to add an empty line between top-level package imports so this:

import os
import sys

from django.db.models.signals import m2m_changed
from django.utils import functional
from django_filters import BooleanFilter
from junitparser import JUnitXml
from junitparser import TestSuite
from loguru import logger

Would turn into this:

import os
import sys

from django.db.models.signals import m2m_changed
from django.utils import functional

from django_filters import BooleanFilter

from junitparser import JUnitXml
from junitparser import TestSuite

from loguru import logger

Am I missing something?

If it is indeed not possible, I'd be willing to push a PR to implement the option. Any push-back ?

thibaut-lo commented 1 year ago

I think that would be a very cool feature @anirudnits.