Skip to content

Commit

Permalink
Switch from pep8 to pycodestyle. closes #2011 (#2012)
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster committed Jul 21, 2016
1 parent a460b3f commit e8487bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions scripts/pep8_on_repo.py → scripts/pycodestyle_on_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand All @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e8487bf

Please sign in to comment.