Remove trailing whitespace

Additionally, added a GitHub Action to ensure no more trailing
whitespace will creep in again in the future.

I'm excluding Markdown files from this check, since trailing whitespace
is significant there, and also excluding `build-aux/install-sh` because
there is significant trailing whitespace on the line that sets
`defaultIFS`.
This commit is contained in:
Kevin Svetlitski 2023-04-28 12:29:49 -07:00 committed by Qi Wang
parent 05385191d4
commit f2e00d2fd3
12 changed files with 70 additions and 53 deletions

10
.github/workflows/check_formatting.yaml vendored Normal file
View File

@ -0,0 +1,10 @@
name: 'Check Formatting'
on: [pull_request]
jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Check for trailing whitespace
run: scripts/check_trailing_whitespace.sh

View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
if git grep -E '\s+$' -- ':!*.md' ':!build-aux/install-sh'
then
echo 'Error: found trailing whitespace' 1>&2
exit 1
fi