Add type hints for the rest of djblets.integrations.

Review Request #12995 — Created April 27, 2023 and updated

chipx86
Djblets
release-3.x
djblets

This adds type hints for all remaining modules and tests in
djblets.integrations, helping people develop or work with
integrations.

A couple minor issues were caught by fixing up types, but had no impact
on consumers:

  • IntegrationConfigForm could crash if manually calling
    get_key_value() or set_key_value() if creating a new
    configuration.

  • Unit test setup for IntegrationConfig's manager wasn't correct. We
    were overriding a classmethod with a standard member function.

With this change, djblets.integrations is now fully typed.

Unit tests, mypy, and pyright pass.

Summary
Add type hints for the rest of djblets.integrations.
Description From Last Updated

Should we be using object or Any?

daviddavid

Same question here.

daviddavid
david
  1. 
      
  2. djblets/integrations/models.py (Diff revision 1)
     
     
     

    Should we be using object or Any?

  3. djblets/integrations/models.py (Diff revision 1)
     
     

    Same question here.

  4. 
      
chipx86
Review request changed

Change Summary:

Switched from object to Any for setting values.

Commits:

Summary
-
Add type hints for the rest of djblets.integrations.
+
Add type hints for the rest of djblets.integrations.

Diff:

Revision 2 (+610 -240)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
Loading...