Add typing and modernize docs for resource subclasses.

Review Request #14245 — Created Nov. 13, 2024 and submitted

Information

RBTools
master

Reviewers

This change modernizes the existing resource subclasses, fixing up
typing and documentation. This also adds any missing item or list
resource subclasses to match the ones we have.

  • Ran unit tests.
  • Used the RBTools API for various tests.
Summary ID
Add typing and modernize docs for resource subclasses.
This change modernizes the existing resource subclasses, fixing up typing and documentation. This also adds any missing item or list resource subclasses to match the ones we have. Testing Done: - Ran unit tests. - Used the RBTools API for various tests.
31d7b46a1d08bd1b09b460e988f3d5f9c0406dfa
Description From Last Updated

multiple spaces after keyword Column: 36 Error code: E271

reviewbotreviewbot

missing whitespace around operator Column: 6 Error code: E225

reviewbotreviewbot

Swap these (ordering issue).

chipx86chipx86

While cleaning up these, it might be a good time to move to keyword-only arguments and use housekeeping to deprecate …

chipx86chipx86

These should probably say dict of ....

chipx86chipx86

Another good candidate, if it's worth moving to kwonly args in this change.

chipx86chipx86

These are in a different order from the argument list.

chipx86chipx86

Another candidate.

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

flake8

david
chipx86
  1. Very nice.

    A few suggestions and couple example places for those suggestions, if you want to make that part of this change, but otherwise this pretty much looks good to go to me.

  2. pyproject.toml (Diff revision 2)
     
     
     
    Show all issues

    Swap these (ordering issue).

  3. rbtools/api/resource/diff.py (Diff revision 2)
     
     
     
     
     
     
     
    Show all issues

    While cleaning up these, it might be a good time to move to keyword-only arguments and use housekeeping to deprecate the positionals. Doesn't have to be in this change (I don't want to expand the scope), so feel free to drop.

    1. Definitely, but something for later. I'll make a note.

  4. rbtools/api/resource/diff.py (Diff revision 2)
     
     
    Show all issues

    These should probably say dict of ....

  5. rbtools/api/resource/draft_diff_commit.py (Diff revision 2)
     
     
     
     
     
    Show all issues

    Another good candidate, if it's worth moving to kwonly args in this change.

  6. rbtools/api/resource/draft_diff_commit.py (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    These are in a different order from the argument list.

  7. rbtools/api/resource/mixins.py (Diff revision 2)
     
     
     
     
     
     
     
     
    Show all issues

    Another candidate.

  8. rbtools/api/resource/review_request.py (Diff revision 2)
     
     

    Just an observation and room for possible future improvement. We type the return of HttpRequest, but document a resource type. The latter is what the caller should ultimately expect but the former is the reality of the function. Not sure what to do there. Should HttpRequest someday be generic with the resulting payload type? Something we can mull over.

    1. This all improves significantly in later changes with @request_method_returns[...]().

  9. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (4651576)
Loading...