Skip to content

Commit

Permalink
fix trailing whitespace check
Browse files Browse the repository at this point in the history
<!-- ps-id: 839007f4-c7f9-4bc8-82e1-99e73a1e11f2 -->

Signed-off-by: Ali Caglayan <[email protected]>
  • Loading branch information
Alizter committed Mar 6, 2024
1 parent 1003a95 commit b0c0bef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/whitespace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ jobs:

- name: Check for trailing whitespaces
run: |
if git grep --cached -n --ignore-case --perl-regexp '\s$' :; then
echo "Trailing whitespaces found. Please remove with:\
etc/fix_trailing_whitespace.sh"
TRAILING_WHITESPACES=$(git grep -l -z -E '\s+$' | xargs -0 sed -n '/\s$/p')
if [ -n "$TRAILING_WHITESPACES" ]; then
echo "Trailing whitespaces found. Please fix with:\
bash ./etc/fix_trailing_whitespaces.sh"
exit 1
fi
Expand Down

0 comments on commit b0c0bef

Please sign in to comment.