Skip to content

Commit bba2928

Browse files
reduce the number of black and isort calls (#2794) (#2796)
(cherry picked from commit c845441) Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>
1 parent 3992848 commit bba2928

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

utils/run-unasync-dsl.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ def main(check=False):
9898
filepaths.append(os.path.join(root, filename))
9999

100100
unasync.unasync_files(filepaths, rules)
101+
output_dirs = []
101102
for dir in source_dirs:
102-
output_dir = f"{dir[0]}_sync_check/" if check else dir[1]
103-
subprocess.check_call(["black", "--target-version=py38", output_dir])
104-
subprocess.check_call(["isort", output_dir])
103+
output_dirs.append(f"{dir[0]}_sync_check/" if check else dir[1])
104+
subprocess.check_call(["black", "--target-version=py38", *output_dirs])
105+
subprocess.check_call(["isort", *output_dirs])
106+
for dir, output_dir in zip(source_dirs, output_dirs):
105107
for file in glob("*.py", root_dir=dir[0]):
106108
# remove asyncio from sync files
107109
subprocess.check_call(

0 commit comments

Comments
 (0)