Merge "Fix fast8 tox env"

This commit is contained in:
Zuul 2024-05-16 21:10:42 +00:00 committed by Gerrit Code Review
commit ef51e9b6b5

View File

@ -11,15 +11,22 @@ fi
echo "Checking last $NUM_COMMITS commits."
cd $(dirname "$0")/..
CHANGED=$(git diff --name-only HEAD~${NUM_COMMITS} | tr '\n' ' ')
CHANGED=""
CHANGED+="$(git diff --name-only HEAD~${NUM_COMMITS} \*.py | tr '\n' ' ')"
while [[ -z $CHANGED ]]; do
# Search back until we find a commit containing python files
NUM_COMMITS=$((NUM_COMMITS + 1))
CHANGED+="$(git diff --name-only HEAD~${NUM_COMMITS} \*.py | tr '\n' ' ')" ;
done
# Skip files that don't exist
# (have been git rm'd)
CHECK=""
for FILE in $CHANGED; do
if [ -f "$FILE" ]; then
CHECK="$CHECK $FILE"
CHECK+="$FILE "
fi
done
diff -u --from-file /dev/null $CHECK | flake8 --diff
flake8 $CHECK