From f976e82f64d99c028bb503c4993754d14ea96996 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:16:00 +0200 Subject: [PATCH] dtc: dt-check-style: Add test for trailing white-space in DTS Add unit tests for expected warnings for trailing white-spaces in DTS (there is only one for YAML files). Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-8-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts | 8 ++++++++ .../dt-style-selftest/expected/dts-trailing-ws.dts.txt | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt diff --git a/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts new file mode 100644 index 000000000000..1eb24d91c640 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; +}; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt new file mode 100644 index 000000000000..94d9ae9d616c --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt @@ -0,0 +1,2 @@ +# mode=relaxed +bad/dts-trailing-ws.dts:5: [trailing-whitespace] trailing whitespace -- knotmirror 0.0.1