diff --git a/tools/fast8.sh b/tools/fast8.sh index 489fc6b3ad8..c1792ae68be 100755 --- a/tools/fast8.sh +++ b/tools/fast8.sh @@ -2,4 +2,14 @@ cd $(dirname "$0")/.. CHANGED=$(git diff --name-only HEAD~2 | tr '\n' ' ') -diff -u --from-file /dev/null $CHANGED | flake8 --diff + +# Skip files that don't exist +# (have been git rm'd) +CHECK="" +for FILE in $CHANGED; do + if [ -f "$f" ]; then + CHECK="$CHECK $FILE" + fi +done + +diff -u --from-file /dev/null $CHECK | flake8 --diff