-
-
Notifications
You must be signed in to change notification settings - Fork 605
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When using import_heading
for a section and the import is not at module level the isort-ed code is now perfectly formatted (#1290) but it does not pass the check anymore.
Here's a simple example for demonstration
import isort
code = """
try:
import logging
from os import abc, path
except ImportError:
pass
"""
extra_config = {"import_heading_stdlib": "stdlib"}
# checking code leads to error
isort.check_code(isort.code(code, **extra_config), **extra_config)
ERROR: Imports are incorrectly sorted and/or formatted.
False
# the fixes are applied once
isort.code(code, **extra_config) == isort.code(isort.code(code, **extra_config), **extra_config)
True
When running isort
on the command-line it says that the file is fixed but nothing is changed and this leads to an infinite loop.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working