summaryrefslogtreecommitdiff
path: root/util/lint/lint-stable-029-kconfig-name-selects
diff options
context:
space:
mode:
authorMartin Roth <gaumless@gmail.com>2023-11-09 14:06:56 -0700
committerMartin L Roth <gaumless@gmail.com>2023-11-18 01:58:24 +0000
commitc8dc4a3bd1f93a02c47768f4ef122f67bb1a8fe3 (patch)
tree9d4c66f8bb9c8a1060324fcaeae1ec8fd208bb8d /util/lint/lint-stable-029-kconfig-name-selects
parent7e775cf893198d88249895c7cc95c5158fff74e4 (diff)
util/lint: Add linter to keep selects out of Kconfig.name
While having select statements in Kconfig.name files is valid in the syntax of the Kconfig language, having the selections split between the normal Kconfig file and Kconfig.name files makes it harder to see what's going on. Kconfig.name files will now be limited to their original purpose of selecting a particular board or board variant, not actually configuring that board. Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: I2aab78e296f2958e77a938b1afa40a25a6aa82b0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78972 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'util/lint/lint-stable-029-kconfig-name-selects')
-rwxr-xr-xutil/lint/lint-stable-029-kconfig-name-selects16
1 files changed, 16 insertions, 0 deletions
diff --git a/util/lint/lint-stable-029-kconfig-name-selects b/util/lint/lint-stable-029-kconfig-name-selects
new file mode 100755
index 0000000000..78d6070805
--- /dev/null
+++ b/util/lint/lint-stable-029-kconfig-name-selects
@@ -0,0 +1,16 @@
+#!/usr/bin/env sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# DESCR: Check that boards don't use select Kconfig.name
+
+export LC_ALL=C
+FAIL=0
+
+for board in src/mainboard/*/*; do
+ if [ -f ${board}/Kconfig.name ] && grep -q "select " "${board}/Kconfig.name"; then
+ echo "Mainboard ${board} uses 'select' in Kconfig.name"
+ FAIL=1
+ fi
+done
+
+exit ${FAIL}