3 # SPDX-License-Identifier: GPL-2.0-only
5 # DESCR: Check for auto-included headers
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" ]
19 GREP_FILES
="git grep -n"
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"; \