Skip to content

Commit

Permalink
Fix black compatibility for .pyi type stub files
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Dec 6, 2022
1 parent 12cc5fb commit c098db3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions isort/output.py
Expand Up @@ -209,9 +209,10 @@ def sorted_imports(
break

if config.lines_after_imports != -1:
formatted_output[imports_tail:0] = [
"" for line in range(config.lines_after_imports)
]
lines_after_imports = config.lines_after_imports
if config.profile == "black" and extension == "pyi": # special case for black
lines_after_imports = 1
formatted_output[imports_tail:0] = ["" for line in range(lines_after_imports)]
elif extension != "pyi" and next_construct.startswith(STATEMENT_DECLARATIONS):
formatted_output[imports_tail:0] = ["", ""]
else:
Expand Down

0 comments on commit c098db3

Please sign in to comment.