soc/amd/common/blocks/include: rename gpio_banks.h to gpio.h
[coreboot.git] / util / lint / lint-stable-003-whitespace
blobfd4d0e4d12ef9f4e9d81aaa518bfd0c40f3e4ca2
1 #!/usr/bin/env sh
3 # SPDX-License-Identifier: GPL-2.0-only
5 # DESCR: Check for superfluous whitespace in the tree
7 LC_ALL=C export LC_ALL
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.,"
17 else
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)" | \
22 xargs -I % \
23 grep -l "[[:space:]][[:space:]]*$" % | \
24 sed -e "s,^.*$,File & has lines ending with whitespace.,"