isort looks throw off by comments

Created on 5 Jul 2020  路  2Comments  路  Source: PyCQA/isort

I've tried to upgrade the Home Assistant project today to isort 5.0.3, unfortunately, that seems to be not happening.

I've used the following config in setup.cfg:

[isort]
profile=black
indent = "    "
force_sort_within_sections = true
sections = FUTURE,STDLIB,INBETWEENS,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
default_section = THIRDPARTY
known_first_party = homeassistant,tests
forced_separate = tests
combine_as_imports = true

After I run isort everything seems fine. However, when I run it again, it modifies some files again, and again, and again...

After a couple of runs, I end up with files like this:

image

bug

All 2 comments

Thanks for reporting! This is fixed in the isort 5.0.4 patch release, with a regression test added to ensure it doesn't happen again

Thanks for the quick response on this @timothycrosley, that is appreciated 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peteboothroyd picture peteboothroyd  路  3Comments

and-semakin picture and-semakin  路  3Comments

ionelmc picture ionelmc  路  3Comments

jedie picture jedie  路  3Comments

lee-kagiso picture lee-kagiso  路  4Comments