Consolidate keyword argument building for diff() calls.
Review Request #12238 — Created April 18, 2022 and submitted
rbt post
has a lot of duplication of logic when it comes to building
diffs. There are two functions responsible for diff building:
_get_diff_history()
and_get_squashed_diff()
. Both build the same
dictionary of common keyword arguments up-front._get_diff_history()
then proceeds to make multiplediff()
calls and passes in (and
re-computes) values for each call, rather than putting those into the
common dictionary.This change introduces
_build_get_diff_kwargs()
, which computes all
actual common arguments. These functions then call them and pass the
results into eachdiff()
call. This simplifies their code
considerably, and should help avoid issues in the future.
Tested posting squashed and history diffs for review locally. Posted
this change as well.
rbt post
unit tests pass.
Summary | ID |
---|---|
22fee3ea2894a2ed4a1dddc0ee75e55129c980ec |
Description | From | Last Updated |
---|---|---|
F841 local variable 'options' is assigned to but never used |
reviewbot |
- Change Summary:
-
Removed an unused variable.
- Commits:
-
Summary ID e373e9d8344579d21f0b3d029d484a9ab2c1565e 33df95e8c2194aed241a6d491bc07bf7e4429b30 - Diff:
-
Revision 2 (+108 -82)
Checks run (2 succeeded)
- Change Summary:
-
Removed some unwanted blank lines where debug statements were.
- Commits:
-
Summary ID 33df95e8c2194aed241a6d491bc07bf7e4429b30 22fee3ea2894a2ed4a1dddc0ee75e55129c980ec - Diff:
-
Revision 3 (+108 -86)