From 2bf2814addf5352e4d6f07d899961c817102d2b4 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 8 Sep 2025 09:34:22 -0700 Subject: [PATCH] Fix fast8 tox target This is a major timesaver for repos the size of nova. This broke recently due to changes in flake8 itself. This removes some needless complexity to make it work again. It also removes the suggestion to use pre-commit which has nothing to do with this target, which also stings more when pre-commit is breaking things which is why you're using this in the first place. Change-Id: Ieb150bf0931ad8031ca83bae1f206075a9f505e2 Signed-off-by: Dan Smith --- tools/flake8wrap.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/flake8wrap.sh b/tools/flake8wrap.sh index c7478ac484ac..367bbaf33cb0 100755 --- a/tools/flake8wrap.sh +++ b/tools/flake8wrap.sh @@ -11,15 +11,10 @@ if test "x$1" = "x-HEAD" ; then shift - files=$(git diff --name-only HEAD~1 | tr '\n' ' ') + files=$(git diff --name-only HEAD~1 | grep '.py$' | tr '\n' ' ') echo "Running flake8 on ${files}" echo "" - echo "Consider using the 'pre-commit' tool instead." - echo "" - echo " pip install --user pre-commit" - echo " pre-commit install --allow-missing-config" - echo "" - diff -u --from-file /dev/null ${files} | flake8 --diff "$@" + flake8 "$@" $files else echo "Running flake8 on all files" echo ""