From 00f2ab3e8901f6ed50441848bae359cb569e3ada Mon Sep 17 00:00:00 2001 From: mlevesquedion Date: Wed, 27 Mar 2024 11:56:57 -0700 Subject: [PATCH] Check whitespace in all files except bytecode and image/vector files (#2130) The root cause of #2129 is that Python files (ending in `.py`) were excluded from the whitespace check. I originally proposed expanding the list of included files to include Python files, but @ghpvnist pointed out that there are more files that need this check than files that don't and suggested using an exclude list, so I did that instead. Also, use `-E` and rewrite the pattern to allow the exclude list to be expanded more easily in the future. Fixes #2129 --- build_tools/github_actions/lint_whitespace_checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools/github_actions/lint_whitespace_checks.sh b/build_tools/github_actions/lint_whitespace_checks.sh index 77e6e3d6bb9..cc4fa32657b 100755 --- a/build_tools/github_actions/lint_whitespace_checks.sh +++ b/build_tools/github_actions/lint_whitespace_checks.sh @@ -40,7 +40,7 @@ if [[ $# -ne 0 ]] ; then fi echo "Gathering changed files..." -mapfile -t CHANGED_FILES < <(git diff "$BASE_BRANCH" HEAD --name-only --diff-filter=d | grep '.*\.cpp$\|.*\.h$\|.*\.md$\|.*\.mlir$\|.*\.sh$\|.*\.td$\|.*\.txt$\|.*\.yml$\|.*\.yaml$') +mapfile -t CHANGED_FILES < <(git diff "$BASE_BRANCH" HEAD --name-only --diff-filter=d | grep -Ev '.*\.(bc|png|svg)$') if (( ${#CHANGED_FILES[@]} == 0 )); then echo "No files to check." exit 0