Here is a minimal example (or at least as small as I could get it) tested with version 5.10.1:
importisortstr_in="""# Some header, e.g. copyright from foo import bardef main(): ..."""str_out=isort.code(
str_in,
lines_before_imports=1
)
print("In:")
print(str_in)
print("-"*79)
print("Out:")
print(str_out)
This yields the following:
In:
# Some header, e.g. copyright
from foo import bar
def main():
...
-------------------------------------------------------------------------------
Out:
# Some header, e.g. copyright
from foo import bar
def main():
...
So instead of making sure that there is one blank line above the import, isort adds 1 extra line at the top of the imports. This breaks similarly with lines_before_imports=2 and so on.
The text was updated successfully, but these errors were encountered:
Here is a minimal example (or at least as small as I could get it) tested with version 5.10.1:
This yields the following:
So instead of making sure that there is one blank line above the import, isort adds 1 extra line at the top of the imports. This breaks similarly with
lines_before_imports=2
and so on.The text was updated successfully, but these errors were encountered: