mb/lenovo/t530: Convert to ASL 2.0 syntax
[coreboot.git] / util / lint / lint-stable-019-header-files
blob11cb6b750c91d6728ce6ef517f6d630b359ac6b6
1 #!/bin/sh
3 # SPDX-License-Identifier: GPL-2.0-only
5 # DESCR: Check for auto-included headers
7 LC_ALL=C export LC_ALL
9 INCLUDED_DIRS='^src/'
10 EXCLUDED_FILES='src/include/kconfig.h'
12 # TODO: Add rules when those patches are complete
13 HEADER_FILES="k*config"
15 # Use git grep if the code is in a git repo, otherwise use grep.
16 if [ -n "$(command -v git)" ] && \
17 [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]
18 then
19 GREP_FILES="git grep -n"
20 else
21 GREP_FILES="grep -rn"
24 for header in $HEADER_FILES; do
25 ${GREP_FILES} "#\s*include\s\+[\"<]\s*${header}\.h\s*[\">]" | \
26 grep "$INCLUDED_DIRS" | \
27 grep -v "$EXCLUDED_FILES"; \
28 done