@@ -64,7 +64,7 @@ def import_type(line: str, config: Config = DEFAULT_CONFIG) -> Optional[str]:
64
64
return None
65
65
66
66
67
- def _strip_syntax (import_string : str ) -> str :
67
+ def strip_syntax (import_string : str ) -> str :
68
68
import_string = import_string .replace ("_import" , "[[i]]" )
69
69
import_string = import_string .replace ("_cimport" , "[[ci]]" )
70
70
for remove_syntax in ["\\ " , "(" , ")" , "," ]:
@@ -276,7 +276,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
276
276
nested_comments = {}
277
277
import_string , comment = parse_comments (line )
278
278
comments = [comment ] if comment else []
279
- line_parts = [part for part in _strip_syntax (import_string ).strip ().split (" " ) if part ]
279
+ line_parts = [part for part in strip_syntax (import_string ).strip ().split (" " ) if part ]
280
280
if type_of_import == "from" and len (line_parts ) == 2 and comments :
281
281
nested_comments [line_parts [- 1 ]] = comments [0 ]
282
282
@@ -286,7 +286,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
286
286
index += 1
287
287
if new_comment :
288
288
comments .append (new_comment )
289
- stripped_line = _strip_syntax (line ).strip ()
289
+ stripped_line = strip_syntax (line ).strip ()
290
290
if (
291
291
type_of_import == "from"
292
292
and stripped_line
@@ -310,7 +310,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
310
310
and ")" not in line .split ("#" )[0 ]
311
311
and index < line_count
312
312
):
313
- stripped_line = _strip_syntax (line ).strip ()
313
+ stripped_line = strip_syntax (line ).strip ()
314
314
if (
315
315
type_of_import == "from"
316
316
and stripped_line
@@ -326,7 +326,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
326
326
index += 1
327
327
if new_comment :
328
328
comments .append (new_comment )
329
- stripped_line = _strip_syntax (line ).strip ()
329
+ stripped_line = strip_syntax (line ).strip ()
330
330
if (
331
331
type_of_import == "from"
332
332
and stripped_line
@@ -337,7 +337,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
337
337
import_string += line_separator + line
338
338
raw_lines .append (line )
339
339
340
- stripped_line = _strip_syntax (line ).strip ()
340
+ stripped_line = strip_syntax (line ).strip ()
341
341
if (
342
342
type_of_import == "from"
343
343
and stripped_line
@@ -378,7 +378,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
378
378
379
379
just_imports = [
380
380
item .replace ("{|" , "{ " ).replace ("|}" , " }" )
381
- for item in _strip_syntax (import_string ).split ()
381
+ for item in strip_syntax (import_string ).split ()
382
382
]
383
383
384
384
attach_comments_to : Optional [List [Any ]] = None
0 commit comments