mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
4088eb434b
I noticed when running pylint (as the SUBMITTING_PATCHES file directs) that there were a number of violations reported. This makes it difficult to see violations I might have introduced. This commit corrects all pylint violations in the repo script. First I ran this to clean up the formatting: autopep8 --max-line-length=80 --indent-size 2 repo Following that the following violations remained: % pylint --rcfile=.pylintrc repo ************* Module repo W:220,21: Redefining name 'init_optparse' from outer scope (line 156) (redefined-outer-name) W:482, 2: No exception type(s) specified (bare-except) C:704, 0: Old-style class defined. (old-style-class) For line 220, the parameter to _GitcInitOptions was renamed so as not to mask the init_optparse global. For line 482, a pylint directive was added to disable the bare-execpt violation for just that line. For line 704, the _Options class was changed to subclass object. Additionally, the comments at lines 107-113 were spaced out to line up with the comment at line 112 that autopep8 moved. This script now has a pylint score of 10.0 Change-Id: I779b66eb6b061a195d3c4372b99dec1b6d2a214f |
||
---|---|---|
docs | ||
hooks | ||
subcmds | ||
tests | ||
.gitattributes | ||
.gitignore | ||
.project | ||
.pydevproject | ||
.pylintrc | ||
color.py | ||
command.py | ||
COPYING | ||
editor.py | ||
error.py | ||
git_command.py | ||
git_config.py | ||
git_refs.py | ||
git_ssh | ||
gitc_utils.py | ||
main.py | ||
manifest_xml.py | ||
pager.py | ||
progress.py | ||
project.py | ||
pyversion.py | ||
repo | ||
SUBMITTING_PATCHES | ||
trace.py | ||
wrapper.py |