Clean up BaseSCMClient and make better use of type annotations.

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

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.

Commits

Files

    Loading...