[PATCH v4 0/7] dtc: dt-check-style: Improvement after using on DTS

Krzysztof Kozlowski posted 7 patches 1 week, 5 days ago
There is a newer version of this series
.../devicetree/bindings/dts-coding-style.rst       |  15 +--
scripts/dtc/dt-check-style                         | 104 ++++++++++++---------
.../dt-style-selftest/bad/dts-child-name-order.dts |  30 ++++++
.../bad/dts-extend-node-child-name-order.dts       |  23 +++++
.../bad/dts-extend-node-digit-node-order.dts       |  31 ++++++
.../dtc/dt-style-selftest/bad/dts-mixed-indent.dts |  20 ++++
.../dt-style-selftest/bad/dts-property-order.dts   |  43 +++++++++
.../bad/yaml-prop-order-device-type.yaml           |  31 ++++++
.../expected/dts-child-name-order.dts.txt          |   2 +
.../dts-extend-node-child-name-order.dts.txt       |   2 +
.../dts-extend-node-digit-node-order.dts.txt       |   2 +
.../expected/dts-mixed-indent.dts.txt              |   8 ++
.../expected/dts-property-order.dts.txt            |   6 ++
.../dt-style-selftest/expected/dts-spaces.dts.txt  |   2 +-
.../expected/yaml-indent-strict.yaml.txt           |   2 +-
.../expected/yaml-mixed-indent.yaml.txt            |   3 +-
.../expected/yaml-prop-order-device-type.yaml.txt  |   2 +
.../dt-style-selftest/expected/yaml-tab.yaml.txt   |   2 +-
.../good/dts-child-name-order.dts                  |  30 ++++++
.../good/dts-digit-node-order.dts                  |  41 ++++++++
scripts/dtc/dt-style-selftest/good/dts-dtc.dts     |  21 +++++
.../good/dts-extend-node-child-name-order.dts      |  23 +++++
.../good/dts-extend-node-digit-node-order.dts      |  31 ++++++
.../dt-style-selftest/good/dts-preprocessor.dts    |  21 +++++
.../dt-style-selftest/good/dts-property-order.dts  |  41 ++++++++
scripts/dtc/dt-style-selftest/good/soc.dtsi        |  47 ++++++++++
26 files changed, 526 insertions(+), 57 deletions(-)
[PATCH v4 0/7] dtc: dt-check-style: Improvement after using on DTS
Posted by Krzysztof Kozlowski 1 week, 5 days ago
Changes in v4:
1. Drop patch:
   "dtc: dt-check-style: Do not sort top-level nodes in DTS by unit address"
   This needs more work.
2. Patch #1: Rename rule tab-in-dts to tab-in-yaml
3. Drop "memory@a0000000" in examples, because it messes with top-level
   sorting.  Use a "cpus" node to test node and device_type property ordering.
4. Add more test-cases: within existing commits and a new patch at the
   end:
   "dtc: dt-check-style: Add more DTS test cases"
5. Handle #include and /include/ without trailing space

Link to v3: https://patch.msgid.link/20260706-dts-style-checker-v3-0-03ffacff9226@oss.qualcomm.com

Changes in v3:
1. Patch #2: Use re.search
2. Patch #2: Add dts-mixed-indent.dts test case
3. Several new patches 3-7.
v2: https://lore.kernel.org/r/20260706102421.343639-4-krzysztof.kozlowski@oss.qualcomm.com/

Changes in v2:
1. Patch #2: Rework idea.
2. Adjust function doc/comment.
v1: https://lore.kernel.org/r/20260706071446.87669-2-krzysztof.kozlowski@oss.qualcomm.com/

(I was not using b4 for v1 and v2, so b4 diff might fail)

Best regards,
Krzysztof

---
Krzysztof Kozlowski (7):
      dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML
      dtc: dt-check-style: Allow space-aligning indentation in DTS
      dtc: dt-check-style: Rework handling YAML/DTS in rules
      dtc: dt-check-style: Expect first device_type
      dtc: dt-check-style: Handle properly DTC-style includes
      dtc: dt-check-style: Print proper line number of indentation detection place
      dtc: dt-check-style: Add more DTS test cases

 .../devicetree/bindings/dts-coding-style.rst       |  15 +--
 scripts/dtc/dt-check-style                         | 104 ++++++++++++---------
 .../dt-style-selftest/bad/dts-child-name-order.dts |  30 ++++++
 .../bad/dts-extend-node-child-name-order.dts       |  23 +++++
 .../bad/dts-extend-node-digit-node-order.dts       |  31 ++++++
 .../dtc/dt-style-selftest/bad/dts-mixed-indent.dts |  20 ++++
 .../dt-style-selftest/bad/dts-property-order.dts   |  43 +++++++++
 .../bad/yaml-prop-order-device-type.yaml           |  31 ++++++
 .../expected/dts-child-name-order.dts.txt          |   2 +
 .../dts-extend-node-child-name-order.dts.txt       |   2 +
 .../dts-extend-node-digit-node-order.dts.txt       |   2 +
 .../expected/dts-mixed-indent.dts.txt              |   8 ++
 .../expected/dts-property-order.dts.txt            |   6 ++
 .../dt-style-selftest/expected/dts-spaces.dts.txt  |   2 +-
 .../expected/yaml-indent-strict.yaml.txt           |   2 +-
 .../expected/yaml-mixed-indent.yaml.txt            |   3 +-
 .../expected/yaml-prop-order-device-type.yaml.txt  |   2 +
 .../dt-style-selftest/expected/yaml-tab.yaml.txt   |   2 +-
 .../good/dts-child-name-order.dts                  |  30 ++++++
 .../good/dts-digit-node-order.dts                  |  41 ++++++++
 scripts/dtc/dt-style-selftest/good/dts-dtc.dts     |  21 +++++
 .../good/dts-extend-node-child-name-order.dts      |  23 +++++
 .../good/dts-extend-node-digit-node-order.dts      |  31 ++++++
 .../dt-style-selftest/good/dts-preprocessor.dts    |  21 +++++
 .../dt-style-selftest/good/dts-property-order.dts  |  41 ++++++++
 scripts/dtc/dt-style-selftest/good/soc.dtsi        |  47 ++++++++++
 26 files changed, 526 insertions(+), 57 deletions(-)
---
base-commit: 37de3f626a5094b9f3af93bf4c93a6130f8a8b6d
change-id: 20260706-dts-style-checker-750a187f41d7

Best regards,
--  
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>