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.

Commits

Files