Prep work for diff settings layers.

Review Request #14432 — Created May 9, 2025 and submitted

Information

Review Board
release-7.1.x

Reviewers

This change does some initial clean-up in preparation for implementing
settings layers in the diff settings object.

Ran unit tests.

Summary ID
Prep work for diff settings layers.
This change does some initial clean-up in preparation for implementing settings layers in the diff settings object. Testing Done: Ran unit tests.
962c84aa1235359593b7a1dc5598570f9ac78e8d
Description From Last Updated

line too long (94 > 79 characters) Column: 80 Error code: E501

reviewbotreviewbot

line too long (82 > 79 characters) Column: 80 Error code: E501

reviewbotreviewbot

line too long (82 > 79 characters) Column: 80 Error code: E501

reviewbotreviewbot

This doesn't need the parens.

maubinmaubin

Can you move some of these into the TYPE_CHECKING block.

maubinmaubin

Just checking - for casting we have to use Optional instead of | None?

maubinmaubin

We can't use dict on RB 7.1.x. We still require 3.8+. Same below with other casts.

chipx86chipx86

We have to use Tuple here.

chipx86chipx86

We can't use this form on Python 3.8.

chipx86chipx86

We can't use these forms. Same below.

chipx86chipx86

'typing.TYPE_CHECKING' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

This needs to be List[str].

chipx86chipx86

This needs to be Dict[str, Any].

chipx86chipx86
There are no open issues
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
maubin
  1. 
      
  2. reviewboard/codesafety/checkers/base.py (Diff revision 2)
     
     
    Show all issues

    This doesn't need the parens.

  3. reviewboard/diffviewer/settings.py (Diff revision 2)
     
     
    Show all issues

    Can you move some of these into the TYPE_CHECKING block.

    1. Looks like no for all of these.

  4. reviewboard/diffviewer/settings.py (Diff revision 2)
     
     
    Show all issues

    Just checking - for casting we have to use Optional instead of | None?

    1. Yeah, X | Y at runtime only works for Python 3.10+

  5. 
      
david
maubin
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. reviewboard/admin/forms/diff_settings.py (Diff revision 3)
     
     
     
     
     
     
    Show all issues

    We can't use dict on RB 7.1.x. We still require 3.8+.

    Same below with other casts.

  3. Show all issues

    We have to use Tuple here.

  4. Show all issues

    We can't use this form on Python 3.8.

  5. reviewboard/diffviewer/settings.py (Diff revision 3)
     
     
    Show all issues

    We can't use these forms.

    Same below.

  6. 
      
david
Review request changed
Commits:
Summary ID
Prep work for diff settings layers.
This change does some initial clean-up in preparation for implementing settings layers in the diff settings object. Testing Done: Ran unit tests.
95512112dbfefb65f82a9249649fa5141e034382
Prep work for diff settings layers.
This change does some initial clean-up in preparation for implementing settings layers in the diff settings object. Testing Done: Ran unit tests.
e522c047a663af349c392692ef3d265d8ede2c84
Diff:

Revision 4 (+174 -146)

Show changes

reviewboard/admin/forms/diff_settings.py
reviewboard/codesafety/checkers/base.py
reviewboard/codesafety/checkers/trojan_source.py
reviewboard/diffviewer/settings.py
reviewboard/diffviewer/tests/test_diff_settings.py

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
david
david
maubin
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    This needs to be List[str].

  3. Show all issues

    This needs to be Dict[str, Any].

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