From 7eb72b63461f3cc4784994c6844edd001ad461a9 Mon Sep 17 00:00:00 2001 From: Sean Eagan Date: Wed, 17 Oct 2018 10:48:55 -0500 Subject: [PATCH] Reuse .gitignore in whitespace linter Everyhing ignored by git should also be ignored by the whitespace linter, so this prevents having to duplicate this list of files. If we need the whitespace linter to ignore files outside of .gitignore in the future that should be easy to add. Change-Id: I096e5cee7f1874f9db85c2f76ad2f0c709decf50 --- tools/whitespace-linter.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tools/whitespace-linter.sh b/tools/whitespace-linter.sh index 62ad0b60..d4a50b26 100644 --- a/tools/whitespace-linter.sh +++ b/tools/whitespace-linter.sh @@ -1,15 +1,7 @@ #!/usr/bin/env bash -set -xe +set -x -RES=$(find . \ - -not -path "*/\.*" \ - -not -path "*/*.egg-info/*" \ - -not -path "*/releasenotes/build/*" \ - -not -path "*/doc/build/*" \ - -not -name "*.tgz" \ - -not -name "*.html" \ - -not -name "*.pyc" \ - -type f -exec egrep -l " +$" {} \;) +RES=$(git grep -E -l " +$") if [[ -n $RES ]]; then exit 1