3 # SPDX-License-Identifier: GPL-2.0-only
5 # DESCR: Check for superfluous whitespace in the tree
8 EXCLUDELIST
='^src/vendorcode/|^util/kconfig/|^util/nvidia/cbootimage$|COPYING|LICENSE|README|_shipped$|\.patch$|\.bin$|\.hex$|\.jpg$|\.ttf$|\.woff$|\.png$|\.eot$|\.vbt$|\.ico$'
9 INCLUDELIST
="src util payloads Makefile* toolchain.inc tests"
11 # shellcheck disable=SC2086,SC2046
12 if uname |
grep -qi "linux"; then
13 grep -n -H "[[:space:]][[:space:]]*$" \
14 $
(git ls-files
$INCLUDELIST | \
15 grep -Ev "($EXCLUDELIST)" ) | \
16 sed -e "s,^.*$,File & has lines ending with whitespace.,"
18 # The above form is much (100x) faster, but doesn't work
19 # on all systems. A for loop also works but takes 30% longer
20 git ls-files
$INCLUDELIST | \
21 grep -Ev "($EXCLUDELIST)" | \
23 grep -l "[[:space:]][[:space:]]*$" % | \
24 sed -e "s,^.*$,File & has lines ending with whitespace.,"