Modernize the rest of chunk and opcode generators and differ base.

Review Request #14503 — Created July 11, 2025 and updated — Latest diff uploaded

Information

Review Board
master

Reviewers

This change finishes up modernization of the chunk_generator,
differ, and opcode_generator files in the diffviewer. For the most
part this just involves fixing up docstrings and adding type hints.

The one functional change in here is a fix for a subtle bug that I
discovered when working through this: when computing headers, we were
subtracting 1 from the end line numbers of the chunk twice: once in
_new_chunk, and once in _get_interesting_headers. This meant we'd
stop iterating one line too soon. We obviously didn't notice any bugs in
practice, but it's possible that it was affecting the header
computation, especially for chunks that are only a single line.

  • Ran unit tests.
  • Smoke tested a bunch of diffs.

Commits

Files