Add and fix typing in the filediff_creator code.

Review Request #14294 — Created Jan. 16, 2025 and submitted — Latest diff uploaded

Information

Review Board
release-7.1.x

Reviewers

While investigating issues reported by a customer around out-of-order
FileDiffs, I added some typing in order to ensure that there weren't any
surprises in the code or the way that data was structured. In the
process, a few small documentation issues were found, along with a
couple of theoretical type-safety issues.

This change adds type hints throughout this code and ensures safe usage
of values that could be None. It also switches to keyword-only
arguments to allow for future expansion without risk of surprises.

It does not otherwise change anything about FileDiff creation.

Unit tests pass.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add and fix typing in the filediff_creator code.
While investigating issues reported by a customer around out-of-order FileDiffs, I added some typing in order to ensure that there weren't any surprises in the code or the way that data was structured. In the process, a few small documentation issues were found, along with a couple of theoretical type-safety issues. This change adds type hints throughout this code and ensures safe usage of values that could be `None`. It also switches to keyword-only arguments to allow for future expansion without risk of surprises. It does not otherwise change anything about FileDiff creation.
b79e20dab2b092540002144528d970a3043d2a99 Christian Hammond
reviewboard/diffviewer/filediff_creator.py
Loading...