Improve cpep8 scripts (#2355)

This patch adds prints to cpep8.py's scanning function.  It's useful to
know what files the script is scanning during an update, as the in-tree
virtualenv (or other files) may be included by accident.

This patch also fixes cpep8.sh to use the correct path to cpep8.py,
allowing it to be run from anywhere in the source tree.
This commit is contained in:
Zach Welch 2015-03-05 15:11:34 -08:00
parent ccd77bfa9f
commit 4708fc8e52
2 changed files with 3 additions and 1 deletions

View File

@ -90,12 +90,14 @@ def get_exceptions(f):
return ignore
if args.update:
print "Starting update of %d files" % len(manifest)
bad = []
for f in manifest:
checker = pep8.StyleGuide(quiet=True, ignore=get_exceptions(f))
results = checker.check_files([f])
if results.total_errors:
bad.append(f)
print "%s: %s" % (results.total_errors and "FAIL" or "PASS", f)
with file(blacklist_filename, "w") as fh:
print >>fh, """\

View File

@ -17,5 +17,5 @@ fi
source ${VENV}/bin/activate
pip install pep8==${PEP8_VERSION} >${VENV}/pep8.log 2>&1
./tools/cpep8.py "$@"
${TOOLS_DIR}/cpep8.py "$@"
deactivate