Simplify whitespace-linter script

Pegleg currently uses `find` to search files in the whitespace-linter
script. A more simplified approach could be taken by using `git grep`
instead. This method levarages .gitignore so a separate list of files
in the script no longer needs to be maintained. This is the method used
by Airship Armada.

Change-Id: I26a2a95f533b9ff62de784d004f25ade552a5b31
This commit is contained in:
Ian H. Pittwood 2019-04-10 15:24:35 -05:00
parent 05dc91eda4
commit 33286a1173
1 changed files with 4 additions and 11 deletions

View File

@ -1,16 +1,9 @@
#!/usr/bin/env bash
set -xe
RES=$(find . \
-not -path "*/\.*" \
-not -path "*/doc/build/*" \
-not -path "*/doc/source/images/*" \
-not -path "*/htmlcov/*" \
-not -name "*.tgz" \
-not -name "*.pyc" \
-not -name "*.html" \
-type f -exec egrep -l " +$" {} \;)
set -x
RES=$(git grep -E -l " +$")
if [[ -n $RES ]]; then
exit 1;
exit 1
fi