Skip to content

Commit

Permalink
Clean up __main__
Browse files Browse the repository at this point in the history
  • Loading branch information
BlankSpruce committed Jun 11, 2024
1 parent 88650fd commit c9ea7ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gersemi/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def main():
configuration = make_configuration(args)
mode = get_mode(args)

sys.exit(run(mode, configuration, args.workers, args.sources))
sys.exit(run(mode, configuration, args.sources))


if __name__ == "__main__":
Expand Down
6 changes: 2 additions & 4 deletions gersemi/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,10 @@ def handle_files_to_format(
return compute_error_code(code for _, code in results)


def run(
mode: Mode, configuration: Configuration, num_workers: int, sources: Iterable[Path]
):
def run(mode: Mode, configuration: Configuration, sources: Iterable[Path]):
requested_files = get_files(sources)

pool_cm = create_pool(Path("-") in requested_files, num_workers)
pool_cm = create_pool(Path("-") in requested_files, configuration.workers)
with create_cache() as cache, pool_cm() as pool:
already_formatted_files, files_to_format = split_files(
cache, configuration.summary(), requested_files
Expand Down

0 comments on commit c9ea7ca

Please sign in to comment.