Commit 4203e574 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

Refine checking for trailing whitespace [skip travis][skip appveyor]

* Include tabs in checking.
* Use `git grep` to avoid including `.git` directory.
* Avoid running `grep` multiple times.
parent c3ec5861
...@@ -32,9 +32,7 @@ jobs: ...@@ -32,9 +32,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: 🧹 Check for trailing whitespace - name: 🧹 Check for trailing whitespace
run: | run: "! git grep -EIn $'[ \t]+$'"
cd test || exit
sh ./check-for-trailing-whitespace.sh || exit 1
yamllint: yamllint:
name: 🍶 YAML name: 🍶 YAML
runs-on: ubuntu-latest runs-on: ubuntu-latest
......
#!/usr/bin/env bash
cd .. || exit
# print first
grep -EHInr '( +)$' ./*
var=$(grep -EHInr '( +)$' ./*)
# then exit with fail if found
if test -z "$var"; then
exit 0
else
exit 1
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment