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:
parent
05385191d4
commit
f2e00d2fd3
10
.github/workflows/check_formatting.yaml
vendored
Normal file
10
.github/workflows/check_formatting.yaml
vendored
Normal 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
|
7
scripts/check_trailing_whitespace.sh
Executable file
7
scripts/check_trailing_whitespace.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user