cinder/tools/fast8.sh
Eric Harney e64f2bb32c fast8: Skip git rm'd files
Don't print error messages trying to diff files
that have been removed via git rm.

Change-Id: Ia0945541208fd7a8362843587f797506000479fc
2015-11-19 16:15:40 -05:00

16 lines
296 B
Bash
Executable File

#!/bin/bash
cd $(dirname "$0")/..
CHANGED=$(git diff --name-only HEAD~2 | tr '\n' ' ')
# 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