diff --git a/scripts/pep8_on_repo.py b/scripts/pycodestyle_on_repo.py similarity index 76% rename from scripts/pep8_on_repo.py rename to scripts/pycodestyle_on_repo.py index 38a0ab83723a..b43e2bf9b85a 100644 --- a/scripts/pep8_on_repo.py +++ b/scripts/pycodestyle_on_repo.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Custom script to run pep8 on gcloud codebase. +"""Custom script to run pycodestyle on gcloud codebase. -This runs pep8 as a script via subprocess but only runs it on the +This runs pycodestyle as a script via subprocess but only runs it on the .py files that are checked in to the repository. """ @@ -25,15 +25,15 @@ def main(): - """Run pep8 on all Python files in the repository.""" + """Run pycodestyle on all Python files in the repository.""" git_root = subprocess.check_output( ['git', 'rev-parse', '--show-toplevel']).strip() os.chdir(git_root) python_files = subprocess.check_output(['git', 'ls-files', '*py']) python_files = python_files.strip().split() - pep8_command = ['pep8'] + python_files - status_code = subprocess.call(pep8_command) + pycodestyle_command = ['pycodestyle'] + python_files + status_code = subprocess.call(pycodestyle_command) sys.exit(status_code) diff --git a/tox.ini b/tox.ini index a7c525cb9d78..5974cb3a93d0 100644 --- a/tox.ini +++ b/tox.ini @@ -129,10 +129,10 @@ verbose = 1 basepython = python2.7 commands = - python {toxinidir}/scripts/pep8_on_repo.py + python {toxinidir}/scripts/pycodestyle_on_repo.py python {toxinidir}/scripts/run_pylint.py deps = - pep8 + pycodestyle pylint >= 1.6.4 unittest2 psutil