Skip to content

Commit

Permalink
Check whitespace in all files except bytecode and image/vector files (o…
Browse files Browse the repository at this point in the history
…penxla#2130)

The root cause of openxla#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 openxla#2129
  • Loading branch information
mlevesquedion authored Mar 27, 2024
1 parent f4459e7 commit 00f2ab3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build_tools/github_actions/lint_whitespace_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00f2ab3

Please sign in to comment.