Add a new Tool.build_base_command() for centralizing command building.

Review Request #11548 — Created March 22, 2021 and submitted

Information

ReviewBot
release-3.0.x

Reviewers

Several tools need to build a command that refers to a temporary
configuration file, to control tool behavior. To avoid a lot of repeated
work and the creation of many temporary files, some tools create part of
the command (and related files) up-front in handle_files() or
execute(). Others don't bother, and this can matter for larger
changes, slowing down execution or flooding the filesystem with
temporary files.

To standardize behavior, this change introduces a new
Tool.build_base_command() method. This will be called in execute(),
and the result will be passed on to handle_files() and
handle_file(), which can then build onto it to construct and execute
the command.

This is disabled for legacy tools.

Unit tests pass on Python 2.7 and 3.x.

Summary ID
Add a new Tool.build_base_command() for centralizing command building.
Several tools need to build a command that refers to a temporary configuration file, to control tool behavior. To avoid a lot of repeated work and the creation of many temporary files, some tools create part of the command (and related files) up-front in `handle_files()` or `execute()`. Others don't bother, and this can matter for larger changes, slowing down execution or flooding the filesystem with temporary files. To standardize behavior, this change introduces a new `Tool.build_base_command()` method. This will be called in `execute()`, and the result will be passed on to `handle_files()` and `handle_file()`, which can then build onto it to construct and execute the command. This is disabled for legacy tools.
d4da9062be2bb18f4105527b4c1ef846d8da717a
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (45842e7)
Loading...