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>
This commit is contained in:
Casper Meijn 2021-06-06 10:27:19 +02:00 committed by Kumar Gala
commit d25e5c20a0

View file

@ -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