Fix PEP-257 violations in reviewboard/admin/

Review Request #7060 — Created March 13, 2015 and submitted

Information

Review Board
master
25d3674...

Reviewers

This fixes up existing docstrings to conform to PEP-8 and PEP-257 guidelines,
and adds all missing class and method docstrings in the reviewboard/admin/
directory.

Ran pep257 --ignore=D100,D203 (disables module docstrings and the blank line
before class docstring rules). The only remaining errors were with the way we
wrap our long testcase docstrings.

Description From Last Updated

Should remove the "the".

chipx86chipx86

We should say what the validation functions are checking for, in all the clean functions.

chipx86chipx86

'django_reset' imported but unused

reviewbotreviewbot

ModPythonRequest should just go away.

chipx86chipx86

Looking at the source, I think we always have WSGIRequest these days. We can probably just remove this try/except.

chipx86chipx86

This should say what it does.

chipx86chipx86

Same.

chipx86chipx86

Missing a closing paren.

chipx86chipx86

And here.

chipx86chipx86

This should mention it must be subclassed or will raise an exception.

chipx86chipx86

This should say what it's doing.

chipx86chipx86

And here.

chipx86chipx86

And here.

chipx86chipx86

"identical"

chipx86chipx86

This should say what it's doing.

chipx86chipx86

"site configuration"

chipx86chipx86

Not sure ones like these are worth it. It's not a publicly-exposed class in any way, and the docstring is …

chipx86chipx86

Should say "URL," since we're explicitly dealing with those.

chipx86chipx86

Missing paren.

chipx86chipx86

"update"

chipx86chipx86

'django_reset' imported but unused

reviewbotreviewbot

X509 should be capitalized.

brenniebrennie

""" on next line

brenniebrennie

Should this be "an <li>" because of the way <li> is pronounced ("ell eye") ?

brenniebrennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/admin/checks.py
        reviewboard/admin/forms.py
        reviewboard/admin/management/commands/dumpdb.py
        reviewboard/admin/support.py
        reviewboard/admin/management/evolutions.py
        reviewboard/admin/views.py
        reviewboard/admin/siteconfig.py
        reviewboard/admin/templatetags/rbadmintags.py
        reviewboard/admin/server.py
        reviewboard/admin/management/commands/resolve-check.py
        reviewboard/admin/management/commands/loaddb.py
        reviewboard/admin/validation.py
        reviewboard/admin/management/sites.py
        reviewboard/admin/middleware.py
        reviewboard/admin/widgets.py
        reviewboard/admin/context_processors.py
        reviewboard/admin/security_checks.py
        reviewboard/admin/cache_stats.py
        reviewboard/admin/import_utils.py
        reviewboard/admin/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/admin/checks.py
        reviewboard/admin/forms.py
        reviewboard/admin/management/commands/dumpdb.py
        reviewboard/admin/support.py
        reviewboard/admin/management/evolutions.py
        reviewboard/admin/views.py
        reviewboard/admin/siteconfig.py
        reviewboard/admin/templatetags/rbadmintags.py
        reviewboard/admin/server.py
        reviewboard/admin/management/commands/resolve-check.py
        reviewboard/admin/management/commands/loaddb.py
        reviewboard/admin/validation.py
        reviewboard/admin/management/sites.py
        reviewboard/admin/middleware.py
        reviewboard/admin/widgets.py
        reviewboard/admin/context_processors.py
        reviewboard/admin/security_checks.py
        reviewboard/admin/cache_stats.py
        reviewboard/admin/import_utils.py
        reviewboard/admin/tests.py
    
    
  2. Show all issues
     'django_reset' imported but unused
    
  3. 
      
chipx86
  1. 
      
  2. reviewboard/admin/context_processors.py (Diff revision 1)
     
     
    Show all issues

    Should remove the "the".

  3. reviewboard/admin/forms.py (Diff revision 1)
     
     
    Show all issues

    We should say what the validation functions are checking for, in all the clean functions.

  4. reviewboard/admin/forms.py (Diff revision 1)
     
     
     

    Docstrings are good, but I feel like simple ones like this that basically duplicate the function name (same with some of the "save" functions) aren't really worth it. I mean, it doesn't hurt, and I wouldn't say to remove any of them, but.. well.. thoughts?

    1. I want to get to the point where we can add pep257 to Review Bot. These docstrings are silly, but I don't think it hurts.

  5. reviewboard/admin/middleware.py (Diff revision 1)
     
     
     
    Show all issues

    ModPythonRequest should just go away.

    1. For better or worse, we do still have people with mod_python based deployments, and I'd rather not break their authentication.

  6. reviewboard/admin/middleware.py (Diff revision 1)
     
     
     
     
     
     
    Show all issues

    Looking at the source, I think we always have WSGIRequest these days. We can probably just remove this try/except.

  7. reviewboard/admin/middleware.py (Diff revision 1)
     
     
    Show all issues

    This should say what it does.

  8. reviewboard/admin/middleware.py (Diff revision 1)
     
     
    Show all issues

    Same.

  9. reviewboard/admin/middleware.py (Diff revision 1)
     
     
    Show all issues

    Missing a closing paren.

  10. reviewboard/admin/middleware.py (Diff revision 1)
     
     
    Show all issues

    And here.

  11. reviewboard/admin/security_checks.py (Diff revision 1)
     
     
    Show all issues

    This should mention it must be subclassed or will raise an exception.

  12. reviewboard/admin/security_checks.py (Diff revision 1)
     
     
    Show all issues

    This should say what it's doing.

  13. reviewboard/admin/security_checks.py (Diff revision 1)
     
     
    Show all issues

    And here.

  14. reviewboard/admin/security_checks.py (Diff revision 1)
     
     
    Show all issues

    And here.

  15. reviewboard/admin/security_checks.py (Diff revision 1)
     
     
    Show all issues

    "identical"

  16. reviewboard/admin/security_checks.py (Diff revision 1)
     
     
    Show all issues

    This should say what it's doing.

  17. reviewboard/admin/support.py (Diff revision 1)
     
     
    Show all issues

    "site configuration"

  18. reviewboard/admin/tests.py (Diff revision 1)
     
     
     
    Show all issues

    Not sure ones like these are worth it. It's not a publicly-exposed class in any way, and the docstring is really just extra redundant noise.

  19. reviewboard/admin/validation.py (Diff revision 1)
     
     
    Show all issues

    Should say "URL," since we're explicitly dealing with those.

  20. reviewboard/admin/validation.py (Diff revision 1)
     
     
    Show all issues

    Missing paren.

  21. reviewboard/admin/views.py (Diff revision 1)
     
     
    Show all issues

    "update"

  22. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/admin/checks.py
        reviewboard/admin/forms.py
        reviewboard/admin/management/commands/dumpdb.py
        reviewboard/admin/support.py
        reviewboard/admin/management/evolutions.py
        reviewboard/admin/views.py
        reviewboard/admin/siteconfig.py
        reviewboard/admin/templatetags/rbadmintags.py
        reviewboard/admin/server.py
        reviewboard/admin/management/commands/resolve-check.py
        reviewboard/admin/management/commands/loaddb.py
        reviewboard/admin/validation.py
        reviewboard/admin/management/sites.py
        reviewboard/admin/middleware.py
        reviewboard/admin/widgets.py
        reviewboard/admin/context_processors.py
        reviewboard/admin/security_checks.py
        reviewboard/admin/cache_stats.py
        reviewboard/admin/import_utils.py
        reviewboard/admin/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/admin/checks.py
        reviewboard/admin/forms.py
        reviewboard/admin/management/commands/dumpdb.py
        reviewboard/admin/support.py
        reviewboard/admin/management/evolutions.py
        reviewboard/admin/views.py
        reviewboard/admin/siteconfig.py
        reviewboard/admin/templatetags/rbadmintags.py
        reviewboard/admin/server.py
        reviewboard/admin/management/commands/resolve-check.py
        reviewboard/admin/management/commands/loaddb.py
        reviewboard/admin/validation.py
        reviewboard/admin/management/sites.py
        reviewboard/admin/middleware.py
        reviewboard/admin/widgets.py
        reviewboard/admin/context_processors.py
        reviewboard/admin/security_checks.py
        reviewboard/admin/cache_stats.py
        reviewboard/admin/import_utils.py
        reviewboard/admin/tests.py
    
    
  2. Show all issues
     'django_reset' imported but unused
    
  3. 
      
brennie
  1. 
      
  2. reviewboard/admin/middleware.py (Diff revision 2)
     
     
    Show all issues

    X509 should be capitalized.

  3. reviewboard/admin/security_checks.py (Diff revision 2)
     
     
    Show all issues

    """ on next line

  4. Show all issues

    Should this be "an <li>" because of the way <li> is pronounced ("ell eye") ?

  5. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (7c4d12a)