isort icon indicating copy to clipboard operation
isort copied to clipboard

Adds the line before imports only if there are badly sorted imports

Open YannPourcenoux opened this issue 3 years ago • 0 comments

I am running with lines_before_imports=1 in my config file but the line before imports is added only if there are other changes to do in the file. Example 1: This code

"""
Some docstring
"""
from typing import Dict, List, Union

import tensorflow as tf

does not get formatted. But Example 2 does: This code

"""
Some docstring
"""
from typing import Dict, List, Union
import tensorflow as tf

yields the expected result

"""
Some docstring
"""

from typing import Dict, List, Union

import tensorflow as tf

Does anyone have an idea on how to fix that?

YannPourcenoux avatar May 10 '22 12:05 YannPourcenoux