File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ def sorted_imports(
8888 lines_between = ["" ] * (
8989 config .lines_between_types if from_modules and straight_modules else 0
9090 )
91- if config .from_first :
91+ if config .from_first or section == "FUTURE" :
9292 section_output = from_imports + lines_between + straight_imports
9393 else :
9494 section_output = straight_imports + lines_between + from_imports
@@ -153,6 +153,16 @@ def sorted_imports(
153153 if pending_lines_before or not no_lines_before :
154154 output += ["" ] * config .lines_between_sections
155155
156+ # if (
157+ # section == "FUTURE"
158+ # and len(section_output) > 1
159+ # and not section_output[0].startswith("from")
160+ # ):
161+ # print(">>> section", section)
162+ # print(">>> output", section_output)
163+ # section_output = [section_output[1], section_output[0]]
164+ # print(">>> output", section_output)
165+
156166 output += section_output
157167
158168 pending_lines_before = False
@@ -226,6 +236,7 @@ def sorted_imports(
226236 else :
227237 formatted_output [imports_tail :0 ] = ["" ]
228238
239+ # print(">>> formatted_output", formatted_output)
229240 if parsed .place_imports :
230241 new_out_lines = []
231242 for index , line in enumerate (formatted_output ):
You can’t perform that action at this time.
0 commit comments