From 33286a1173663f8de822b490192fa8d6996c0d36 Mon Sep 17 00:00:00 2001 From: "Ian H. Pittwood" Date: Wed, 10 Apr 2019 15:24:35 -0500 Subject: [PATCH] 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 --- tools/gate/whitespace-linter.sh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tools/gate/whitespace-linter.sh b/tools/gate/whitespace-linter.sh index e96708c3..55f062d3 100755 --- a/tools/gate/whitespace-linter.sh +++ b/tools/gate/whitespace-linter.sh @@ -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