Clean up BaseSCMClient and make better use of type annotations.

Review Request #12558 — Created Aug. 20, 2022 and submitted

Information

RBTools
release-4.x

Reviewers

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 in BaseSCMClient, 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 defining TypedDict-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
Clean up BaseSCMClient and make better use of type annotations.
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 in `BaseSCMClient`, 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 defining `TypedDict`-based types. The subclasses haven't been cleaned up yet, but that can be handled separately.
2f1aae296c4d28676d25d7763ea2042b1685125a
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.x (d490cd0)