Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from pep8 to pycodestyle #2012

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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