Don't call handle_file() if a patched file can't be fetched.
Review Request #11547 — Created March 22, 2021 and submitted
All tools that implement
get_patched_file_path()on the reviewed file, and returning early if
None. Rather than do this in each
makes more sense to do it in
handle_files(), before calling
This change switches to that, and passes in the resulting path as a
handle_file()can operate on it.
We don't perform the check or pass in
pathfor legacy tools, since the
**kwargsand wouldn't expect it.
To handle the legacy tool check, the old base classes now set a
legacy_toolattribute, which the inner class can check. This is
admittedly pretty hacky, but won't exist past Review Bot 3.0, and is
easier to maintain than forking these methods into the old base classes.
Unit tests pass on Python 2.7 and 3.x.
Can you add documentation for legacy_tool?
Added docs for the
legacy_toolattribute, telling people not to touch it.
Revision 2 (+206 -22)
Checks run (2 succeeded)