Do some code housecleaning.

Review Request #12079 — Created Feb. 23, 2022 and submitted

Information

Djblets
release-3.x

Reviewers

This change just makes some relatively mechanical cleanups:

  • Fix iteration of TEMPLATES default to not try to iterate over None
  • Remove or add blank lines and spaces to conform to python style
    standards.
  • Remove some unused variable definitions.
  • Always use cls as the bound variable for classmethods.
  • Fix a place where we were catching a URLError but then accessing
    data that's only available on HTTPError.

Ran unit tests.

Summary ID
Do some code housecleaning.
This change just makes some relatively mechanical cleanups: - Fix iteration of TEMPLATES default to not try to iterate over `None` - Remove or add blank lines and spaces to conform to python style standards. - Remove some unused variable definitions. - Always use `cls` as the bound variable for classmethods. - Fix a place where we were catching a `URLError` but then accessing data that's only available on `HTTPError`. Testing Done: Ran unit tests.
64036f6eee4f400ac64922dc37098a293c161298
Description From Last Updated

Is this correct? We usually have 1 blank line between the module docstring and, say, imports, but then 2 blank …

chipx86chipx86

I think 1 was correct here.

chipx86chipx86

I think 1 was correct here.

chipx86chipx86
chipx86
  1. 
      
  2. djblets/registries/errors.py (Diff revision 1)
     
     
     
     
     
    Show all issues

    Is this correct? We usually have 1 blank line between the module docstring and, say, imports, but then 2 blank lines between classes/the import section/etc. I think 1 is correct here.

    1. I'm not sure why imports are treated differently but flake8 is saying two is appropriate.

    2. Weird. Okay, well, I don't want to fight flake8 on this.

  3. djblets/util/humanize.py (Diff revision 1)
     
     
    Show all issues

    I think 1 was correct here.

  4. djblets/webapi/errors.py (Diff revision 1)
     
     
     
     
     
    Show all issues

    I think 1 was correct here.

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

Status: Closed (submitted)

Change Summary:

Pushed to release-3.x (45e7295)
Loading...