Container Infrastructure Management Service for OpenStack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
515 B

# 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
files=$(git diff --name-only HEAD~1 | tr '\n' ' ')
echo "Running flake8 on ${files}"
diff -u --from-file /dev/null ${files} | flake8 --max-complexity 10 --diff "$@"
echo "Running flake8 on all files"
exec flake8 --max-complexity 10 "$@"