[PATCH v1 07/10] kconfig-checker: Introduce overlays schema
From: Ahmed S. Darwish
Date: Fri Nov 06 2026 - 04:22:10 EST
Keep `expected` and `severity` as optional for every rule.
This allows overlay files to be partial by design: they may override only
selected fields of an existing rule.
Signed-off-by: Ahmed S. Darwish <darwi@xxxxxxxxxxxxx>
---
tools/kconfig-checker/schemas/base.yml | 4 ++--
tools/kconfig-checker/schemas/overlay.yml | 28 +++++++++++++++++++++++
2 files changed, 30 insertions(+), 2 deletions(-)
create mode 100644 tools/kconfig-checker/schemas/overlay.yml
diff --git a/tools/kconfig-checker/schemas/base.yml b/tools/kconfig-checker/schemas/base.yml
index 1cc19752ebd6..6217eaba3e41 100644
--- a/tools/kconfig-checker/schemas/base.yml
+++ b/tools/kconfig-checker/schemas/base.yml
@@ -53,8 +53,8 @@ properties:
# y option is expected to be enabled (built-in or module).
# n option is expected to be disabled or unset.
# allowed option is permitted and must not be reported as a violation.
- # This is used to exempt a specific symbol from a broader
- # `name_pattern` rule with `expected: n`.
+ # This is to be used either by overlays, or to exempt a specific
+ # symbol from a broader `name_pattern` rule with `expected: n`.
#
expected:
type: string
diff --git a/tools/kconfig-checker/schemas/overlay.yml b/tools/kconfig-checker/schemas/overlay.yml
new file mode 100644
index 000000000000..4ac9a364a344
--- /dev/null
+++ b/tools/kconfig-checker/schemas/overlay.yml
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+"$schema": "https://json-schema.org/draft-07/schema#"
+
+title: Schema for kconfig-checker overlay files
+
+#
+# Full rule files require 'expected' and 'severity' for every rule.
+# Overlay files are partial by design: they may override only selected
+# fields of an existing rule, so such fields are not required here.
+#
+# For example, preempt_rt.yml:
+#
+# rules:
+# - name: CONFIG_DRM
+# expected: n
+# severity: info
+# docs_hint: config
+#
+# and a custom-overlay.yml:
+#
+# rules:
+# - name: CONFIG_DRM
+# expected: allow
+#
+
+allOf:
+ - $ref: "base.yml"
--
2.56.0