Add type hints for the diff parsing code.

Review Request #14010 — Created July 3, 2024 and submitted

Information

Review Board
release-7.x

Reviewers

This updates reviewboard.diffviewer.parser to include full type hints,
making it easier to properly implement a diff parser or change diff
parsing logic. This is being done in preparation for additional work for
diff parsers.

Several methods have been updated to require keyword-only arguments,
deprecating positional arguments.

We also had some parameters that were meant to be removed back in
Review Board 6. We never added deprecation warnings for those changes,
so those have been added, and the deprecations have been pushed to
Review Board 9.

Unit tests pass.

Summary ID
Add type hints for the diff parsing code.
This updates `reviewboard.diffviewer.parser` to include full type hints, making it easier to properly implement a diff parser or change diff parsing logic. This is being done in preparation for additional work for diff parsers. Several methods have been updated to require keyword-only arguments, deprecating positional arguments. We also had some parameters that were meant to be removed back in Review Board 6. We never added deprecation warnings for those changes, so those have been added, and the deprecations have been pushed to Review Board 9.
c38f348987f24e2e88b8eef03283bf97b814c2b8
Description From Last Updated

Why this change?

daviddavid

And here too.

daviddavid
david
  1. 
      
  2. reviewboard/diffviewer/parser.py (Diff revision 1)
     
     
     
    Show all issues

    Why this change?

    1. split() returns a list[str]. I could have gone with split(...)[:2], but thought I'd just make the naming clear. Either way would be fine with me though.

    2. Clear naming sounds good. Let's add a blank line before the return statement for both places, though.

  3. reviewboard/diffviewer/parser.py (Diff revision 1)
     
     
     
    Show all issues

    And here too.

  4. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-7.x (9c11994)