@@ -21,7 +21,7 @@ def parse_import_statements(content, filepath):
2121 "name" : subnode .name ,
2222 "lineno" : node .lineno ,
2323 "filepath" : filepath ,
24- "from" : ""
24+ "from" : "" ,
2525 }
2626 modules .append (module )
2727 elif isinstance (node , ast .ImportFrom ) and node .level == 0 :
@@ -30,7 +30,7 @@ def parse_import_statements(content, filepath):
3030 "name" : f"{ node .module } .{ subnode .name } " ,
3131 "lineno" : node .lineno ,
3232 "filepath" : filepath ,
33- "from" : node .module
33+ "from" : node .module ,
3434 }
3535 modules .append (module )
3636 return modules
@@ -52,8 +52,9 @@ def parse(repo_root, rel_package_path, filename):
5252 content = file .read ()
5353 # From simple benchmarks, 2 workers gave the best performance here.
5454 with concurrent .futures .ThreadPoolExecutor (max_workers = 2 ) as executor :
55- modules_future = executor .submit (parse_import_statements , content ,
56- rel_filepath )
55+ modules_future = executor .submit (
56+ parse_import_statements , content , rel_filepath
57+ )
5758 comments_future = executor .submit (parse_comments , content )
5859 modules = modules_future .result ()
5960 comments = comments_future .result ()
@@ -73,12 +74,11 @@ def main(stdin, stdout):
7374 filenames = parse_request ["filenames" ]
7475 outputs = list ()
7576 if len (filenames ) == 1 :
76- outputs .append (parse (repo_root , rel_package_path ,
77- filenames [0 ]))
77+ outputs .append (parse (repo_root , rel_package_path , filenames [0 ]))
7878 else :
7979 futures = [
80- executor .submit (parse , repo_root , rel_package_path ,
81- filename ) for filename in filenames
80+ executor .submit (parse , repo_root , rel_package_path , filename )
81+ for filename in filenames
8282 if filename != ""
8383 ]
8484 for future in concurrent .futures .as_completed (futures ):
0 commit comments