(
    baseline: Baseline,
    target_file_manager: TargetFileManager,
    staged: bool,
    tools: Iterable[Tool],
)
return all_results, elapsed
Manages interactions between TargetFileManager, Runner and Tools

        Uses passed target_file_manager, staged flag, and tool list to setup
        Runner and runs tools on relevant files, returning aggregated output
        of tool running and time to run all tools in parallel
Manages interactions between TargetFileManager, Runner and Tools
Manages interactions between TargetFileManager Runner and Tools
def orchestrate(
    baseline: Baseline,
    target_file_manager: TargetFileManager,
    staged: bool,
    tools: Iterable[Tool],
) -> Tuple[Collection[RunResults], float]:
    """
        Manages interactions between TargetFileManager, Runner and Tools

        Uses passed target_file_manager, staged flag, and tool list to setup
        Runner and runs tools on relevant files, returning aggregated output
        of tool running and time to run all tools in parallel
    """
    elapsed = 0.0
    if staged:
        head_baseline, elapsed = _calculate_head_comparison(target_file_manager, tools)
        for t in tools:
            tool_id = t.tool_id()
            if tool_id not in baseline:
                baseline[tool_id] = head_baseline.get(tool_id, set())
            else:
                baseline[tool_id].update(head_baseline.get(tool_id, set()))

    with target_file_manager.run_context(staged, RunStep.CHECK) as target_paths:
        use_cache = not staged  # if --all then can use cache
        skip_setup = staged  # if check --all then include setup
        runner = Runner(paths=target_paths, use_cache=use_cache, skip_setup=skip_setup)

        if len(runner.paths) == 0:
            echo_warning(
                f"Nothing to check or archive. Please confirm that changes are staged and not excluded by `{IGNORE_FILE_NAME}`. To check all Git tracked files, use `--all`."
            )
            click.secho("", err=True)
            all_results: Collection[RunResults] = []
            elapsed = 0.0
        else:
            before = time.time()
            all_results = runner.parallel_results(tools, baseline)
            elapsed += time.time() - before

    return all_results, elapsed
def orchestrate ( baseline : Baseline , target_file_manager : TargetFileManager , staged : bool , tools : Iterable [ Tool ] , ) -> Tuple [ Collection [ RunResults ] , float ] : elapsed = 0.0 if staged : head_baseline , elapsed = _calculate_head_comparison ( target_file_manager , tools ) for t in tools : tool_id = t . tool_id ( ) if tool_id not in baseline : baseline [ tool_id ] = head_baseline . get ( tool_id , set ( ) ) else : baseline [ tool_id ] . update ( head_baseline . get ( tool_id , set ( ) ) ) with target_file_manager . run_context ( staged , RunStep . CHECK ) as target_paths : use_cache = not staged # if --all then can use cache skip_setup = staged # if check --all then include setup runner = Runner ( paths = target_paths , use_cache = use_cache , skip_setup = skip_setup ) if len ( runner . paths ) == 0 : echo_warning ( f"Nothing to check or archive. Please confirm that changes are staged and not excluded by `{IGNORE_FILE_NAME}`. To check all Git tracked files, use `--all`." ) click . secho ( "" , err = True ) all_results : Collection [ RunResults ] = [ ] elapsed = 0.0 else : before = time . time ( ) all_results = runner . parallel_results ( tools , baseline ) elapsed += time . time ( ) - before return all_results , elapsed