ClearCase updates part 1: basic cleanup

Review Request #13605 — Created March 4, 2024 and submitted

Information

RBTools
release-5.x

Reviewers

This change does some very basic cleanup to the ClearCase implementation
in RBTools:

  • Replace %-format strings with f-strings where it makes sense.
  • Change "unicode" to "str" in docstrings.
  • Remove a few unused private methods.
  • Fix up some line length issues.

Ran unit tests.

Summary ID
ClearCase updates part 1: basic cleanup
This change does some very basic cleanup to the ClearCase implementation in RBTools: - Replace %-format strings with f-strings where it makes sense. - Change "unicode" to "str" in docstrings. - Remove a few unused private methods. - Fix up some line length issues. Testing Done: Ran unit tests.
33848d04e105ad0bcaa8401cc1f848b02b7d47a4
Description From Last Updated

undefined name 'cast' Column: 16 Error code: F821

reviewbotreviewbot

undefined name 'cast' Column: 30 Error code: F821

reviewbotreviewbot

undefined name 'cast' Column: 30 Error code: F821

reviewbotreviewbot

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

reviewbotreviewbot

I think the old logic was more correct. _get_host_info() can return None as a valid result, and when it returns …

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

flake8

david
maubin
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. rbtools/clients/clearcase.py (Diff revision 2)
     
     
     
     
    Show all issues

    I think the old logic was more correct.

    _get_host_info() can return None as a valid result, and when it returns None, that result should be reused. It checks dependencies, calls things, and then logs state. We don't want to do this on each access of the property.

    If we had Djblets's UNSET value, then I'd say switch to that, but we don't. So the flag we had is the more correct option.

    FWIW, this was also pretty recently introduced as part of the dependency work. This was a workaround for the lack of @cached_property (note: Python 3.8+ has a @cached_property, but its design is bad and slow and was redone for Python 3.12, so it's not something we should use yet).

  3. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-5.x (1f25b5d)
Loading...