Browse Source

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
Ian H. Pittwood 1 week ago
parent
commit
33286a1173
1 changed files with 4 additions and 11 deletions
  1. 4
    11
      tools/gate/whitespace-linter.sh

+ 4
- 11
tools/gate/whitespace-linter.sh View File

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

Loading…
Cancel
Save