095edbc367
Currently tox -epep8 will run flake8 on whole code. To make this fast, flake8 support is added for only updated(delta) code. Same can be run by "tox -efast8". Change-Id: I9c55fed32ae3060c21ec278398e9e07fb4a0fe13 Implements: BP tox-pep8-diff-part-only
16 lines
299 B
Bash
Executable File
16 lines
299 B
Bash
Executable File
#!/bin/bash
|
|
|
|
cd $(dirname "$0")/..
|
|
CHANGED=$(git diff --name-only HEAD~1 | tr '\n' ' ')
|
|
|
|
# Skip files that don't exist
|
|
# (have been git rm'd)
|
|
CHECK=""
|
|
for FILE in $CHANGED; do
|
|
if [ -f "$FILE" ]; then
|
|
CHECK="$CHECK $FILE"
|
|
fi
|
|
done
|
|
|
|
diff -u --from-file /dev/null $CHECK | flake8 --diff
|