irc-meetings/test_tools/flake8wrap.sh
John L. Villalovos ffa7d55448 Setup a tox pep8 check and update test-requirements.txt
Add a tox pep8 check.
Fix PEP8 error in tools/list_ptls.py

Update test-requirements.txt for libraries used.

Change-Id: I179036ebbce555586a711677f45337b364d4847f
2016-05-20 11:04:59 -07:00

21 lines
477 B
Bash
Executable File

#!/bin/bash
#
# A simple wrapper around flake8 which makes it possible
# to ask it to only verify files changed in the current
# git HEAD patch.
#
# Intended to be invoked via tox:
#
# tox -epep8 -- -HEAD
#
if test "x$1" = "x-HEAD" ; then
shift
files=$(git diff --name-only HEAD~1 | tr '\n' ' ')
echo "Running flake8 on ${files}"
diff -u --from-file /dev/null ${files} | flake8 --diff "$@"
else
echo "Running flake8 on all files"
exec flake8 "$@"
fi