Add and fix typing in the filediff_creator code.

Review Request #14294 — Created Jan. 16, 2025 and updated

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.

Summary ID
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
Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2.