Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black profile not compatible with Black (ensure_newline_before_comments not working) #1295

Closed
frenck opened this issue Jul 7, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@frenck
Copy link

frenck commented Jul 7, 2020

Running isort 5.0.4 on the Home Assistant project with the following config:

[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

Example result from isort:

from openzwave.group import ZWaveGroup
from openzwave.network import ZWaveNetwork
# pylint: disable=import-error
from openzwave.option import ZWaveOption

After running black:

from openzwave.group import ZWaveGroup
from openzwave.network import ZWaveNetwork

# pylint: disable=import-error
from openzwave.option import ZWaveOption

It seems like the ensure_newline_before_comments from the Black profile is not being honored.

@timothycrosley timothycrosley added the bug Something isn't working label Jul 8, 2020
@timothycrosley
Copy link
Member

Thank you for reporting! I'm sorry this issue impacted you!

This is fixed in isort 5.0.5 patch release.
It looks like the combination of force_sort_within_sections and ensure_newline_before_comments didn't yet have a test in place, so I've added an additional regression test to ensure this issue doesn't resurface.

Thanks!

~Timothy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants