Clean up BaseSCMClient and make better use of type annotations.
Review Request #12558 — Created Aug. 20, 2022 and submitted
Much of the RBTools codebase involves working with SCMClients. With a
lot being done to enhance SCMClients and prepare them for new diff
tools, sand with variations in expectations on parameters and types,
it's worth taking the time to really standardize the types in use and
the ways in which we define and invoke methods.This change adds type annotations to all the function definitions and
class and instance attributes inBaseSCMClient
, and to add
keyword-only arguments to many of the methods. This will enable type
checking to more strictly check any code going into RBTools from here on
out.Many of the functions today return dictionaries, and we now define what
keys are expected in those by definingTypedDict
-based types.The subclasses haven't been cleaned up yet, but that can be handled
separately.
Unit tests pass on Python 3.7-3.11.
Summary | ID |
---|---|
2f1aae296c4d28676d25d7763ea2042b1685125a |
- Change Summary:
-
Differentiated between keys that must be provided and keys that are truly optional in the
TypedDict
s. - Commits:
-
Summary ID 097752f958ecfdf422b9a414eeeab184183a0fa4 2f1aae296c4d28676d25d7763ea2042b1685125a - Diff:
-
Revision 2 (+920 -310)