zun/tools/flake8wrap.sh
rajat29 26fad638e9 Add the missing task states
Adding tthe following missing task states:

* CONTAINER_PAUSING
* CONTAINER_UNPAUSING
* CONTAINER_KILLING
* CONTAINER_ADDING_SG
* CONTAINER_REMOVING_SG
* NETWORK_ATTACHING
* NETWORK_DETACHING

Change-Id: Ida0de94ea0db7314e6892cd55e479fca7bbedeaf
Closes-Bug:#1748349
2018-02-28 09:25:52 +05:30

21 lines
515 B
Bash
Executable File

#!/bin/sh
#
# 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 --max-complexity 34 --diff "$@"
else
echo "Running flake8 on all files"
exec flake8 --max-complexity 34 "$@"
fi