@@ -64,7 +64,7 @@ def import_type(line: str, config: Config = DEFAULT_CONFIG) -> Optional[str]:
6464 return None
6565
6666
67- def _strip_syntax (import_string : str ) -> str :
67+ def strip_syntax (import_string : str ) -> str :
6868 import_string = import_string .replace ("_import" , "[[i]]" )
6969 import_string = import_string .replace ("_cimport" , "[[ci]]" )
7070 for remove_syntax in ["\\ " , "(" , ")" , "," ]:
@@ -276,7 +276,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
276276 nested_comments = {}
277277 import_string , comment = parse_comments (line )
278278 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 ]
280280 if type_of_import == "from" and len (line_parts ) == 2 and comments :
281281 nested_comments [line_parts [- 1 ]] = comments [0 ]
282282
@@ -286,7 +286,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
286286 index += 1
287287 if new_comment :
288288 comments .append (new_comment )
289- stripped_line = _strip_syntax (line ).strip ()
289+ stripped_line = strip_syntax (line ).strip ()
290290 if (
291291 type_of_import == "from"
292292 and stripped_line
@@ -310,7 +310,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
310310 and ")" not in line .split ("#" )[0 ]
311311 and index < line_count
312312 ):
313- stripped_line = _strip_syntax (line ).strip ()
313+ stripped_line = strip_syntax (line ).strip ()
314314 if (
315315 type_of_import == "from"
316316 and stripped_line
@@ -326,7 +326,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
326326 index += 1
327327 if new_comment :
328328 comments .append (new_comment )
329- stripped_line = _strip_syntax (line ).strip ()
329+ stripped_line = strip_syntax (line ).strip ()
330330 if (
331331 type_of_import == "from"
332332 and stripped_line
@@ -337,7 +337,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
337337 import_string += line_separator + line
338338 raw_lines .append (line )
339339
340- stripped_line = _strip_syntax (line ).strip ()
340+ stripped_line = strip_syntax (line ).strip ()
341341 if (
342342 type_of_import == "from"
343343 and stripped_line
@@ -378,7 +378,7 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte
378378
379379 just_imports = [
380380 item .replace ("{|" , "{ " ).replace ("|}" , " }" )
381- for item in _strip_syntax (import_string ).split ()
381+ for item in strip_syntax (import_string ).split ()
382382 ]
383383
384384 attach_comments_to : Optional [List [Any ]] = None
0 commit comments