From d25e5c20a07203443b2e9fafe30bf8eef852ed23 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Sun, 6 Jun 2021 10:27:19 +0200 Subject: [PATCH] scripts: dts: Produce error for invalid yaml I made an alignment error in a dts binding, but the build was successful. After some debugging I found the following warning explaining the problem: '/home/casper/src/zephyrproject/zephyr/dts/bindings/gpio/ gpio-keys.yaml' appears in binding directories but isn't valid YAML: while parsing a block mapping in "", line 11, column 8 did not find expected key in "", line 18, column 9 I think this should be an error as there shouldn't be any invalid yaml. Signed-off-by: Casper Meijn --- scripts/dts/python-devicetree/src/devicetree/edtlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dts/python-devicetree/src/devicetree/edtlib.py b/scripts/dts/python-devicetree/src/devicetree/edtlib.py index e9bfa56e774c10..7a0c950c30c84a 100644 --- a/scripts/dts/python-devicetree/src/devicetree/edtlib.py +++ b/scripts/dts/python-devicetree/src/devicetree/edtlib.py @@ -334,7 +334,7 @@ def _init_compat2binding(self): # representing the file) raw = yaml.load(contents, Loader=_BindingLoader) except yaml.YAMLError as e: - _LOG.warning( + _err( f"'{binding_path}' appears in binding directories " f"but isn't valid YAML: {e}") continue