• 
      
    Fish Trophy

    david got a fish trophy!

    Fish Trophy

    Split up rbtools.api.resource.

    Review Request #14241 — Created Nov. 11, 2024 and submitted

    Information

    RBTools
    master

    Reviewers

    The resource definitions for RBTools are quite lengthy. While the bulk
    of the current implementation all kind of needs to stick together, we
    can split out individual resource-specific subclasses.

    This change does not make any functional or other cleanup changes to the
    code, just splits it up.

    Ran unit tests.

    Summary ID
    Split up rbtools.api.resource.
    The resource definitions for RBTools are quite lengthy. While the bulk of the current implementation all kind of needs to stick together, we can split out individual resource-specific subclasses. The bulk of this is just splitting up code without making any other cleanup or functional changes. The only exception is DraftDiffResource, which was created for a mimetype that doesn't exist in Review Board (the server-side DraftDiffResource reports its mimetype as `diff` instead of `draft-diff`. This resource subclass has been removed and the old name is aliased to DiffResource. Testing Done: Ran unit tests.
    4d0ca0d1eeef5997bb5e90d7cf79f7f2196f9e98
    Description From Last Updated

    undefined name 'HttpRequest' Column: 19 Error code: F821

    reviewbotreviewbot

    blank line at end of file Column: 1 Error code: W391

    reviewbotreviewbot

    I know there's benefits to this syntax but I kind of don't like using it. It makes it a lot …

    chipx86chipx86

    The role name for these is :py:mod:. This comment applies to all the new modules.

    chipx86chipx86
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    david
    maubin
    1. Ship It!
    2. 
        
    chipx86
    1. 
        
    2. rbtools/api/resource/__init__.py (Diff revision 2)
       
       
      Show all issues

      I know there's benefits to this syntax but I kind of don't like using it. It makes it a lot harder to search the codebase for certain imports (which I've done a lot while working on projects) and to order imports alongside non-relative imports.

      Ages ago, I remember this topic coming up with contributed patches and we decided the benefits of the full class name outweighed the shorter line lengths. I think that's still the right call.

    3. Show all issues

      The role name for these is :py:mod:. This comment applies to all the new modules.

    4. 
        
    david
    chipx86
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (5a6bd07)