Open rec opened 2 years ago
it seems like this is by design: https://github.com/PyCQA/isort/blob/12cc5fbd67eebf92eb2213b03c07b138ae1fb448/isort/settings.py#L278-L281 if this was done my mistake, or a warning should be displayed, let me know and i will create a PR 😄
Hello, how are you? :-) Thanks for a great program.
I did see that code, but I wasn't convinced it was right at all, mainly because it prevented me from getting the formatting we already have in our code:
from five import six
from three import four
import one
import two
and line of code means that we get
from five import six
from three import four
import one
import two
regardless of whether --lines-between-types=0
or not.
In fact, we run my hacked version of isort with line 281 commented out!
I could easily emit a pull request.
Hello, and thanks for a very useful package!
If I set
--force-alphabetical-sort
then an extra line is inserted betweenimport
andfrom
even if--lines-between-types=0
Start with this test file:
Running
isort --lines-between-types=0 test_isort.py
gets:This has no empty line between
import
andfrom
as expected.isort --force-alphabetical-sort --lines-between-types=0 test_isort.py
gives:which you will note adds an empty line!
Thanks and have an excellent weekend.