File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -115,11 +115,7 @@ def partition_source(src: str) -> list[CodePartition]:
115
115
chunks .append (CodePartition (CodeType .CODE , srctext ))
116
116
break
117
117
118
- chunks = [chunk for chunk in chunks if chunk .src ]
119
-
120
- # Make sure we're not removing any code
121
- assert _partitions_to_src (chunks ) == src
122
- return chunks
118
+ return [chunk for chunk in chunks if chunk .src ]
123
119
124
120
125
121
def combine_trailing_code_chunks (
@@ -380,16 +376,6 @@ def apply_import_sorting(
380
376
if new_imports :
381
377
new_imports .pop ()
382
378
383
- # There's the potential that we moved a bunch of whitespace onto the
384
- # beginning of the rest of the code. To fix this, we're going to combine
385
- # all of that code, and then make sure there are two linebreaks to start
386
- restsrc = _partitions_to_src (rest )
387
- restsrc = restsrc .rstrip ()
388
- if restsrc :
389
- rest = [CodePartition (CodeType .CODE , restsrc + '\n ' )]
390
- else :
391
- rest = []
392
-
393
379
return pre_import_code + new_imports + rest
394
380
395
381
You can’t perform that action at this time.
0 commit comments