Browse Source

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 "<unicode string>", line 11, column 8
  did not find expected key
    in "<unicode string>", line 18, column 9

I think this should be an error as there shouldn't be any invalid yaml.

Signed-off-by: Casper Meijn <casper@meijn.net>
pull/36234/head
Casper Meijn 4 years ago committed by Kumar Gala
parent
commit
d25e5c20a0
  1. 2
      scripts/dts/python-devicetree/src/devicetree/edtlib.py

2
scripts/dts/python-devicetree/src/devicetree/edtlib.py

@ -334,7 +334,7 @@ class EDT: @@ -334,7 +334,7 @@ class EDT:
# 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

Loading…
Cancel
Save