Devicetree
 help / color / mirror / Atom feed
* [PATCH] dtc: dt-check-style: Allow space-aligning indentation in DTS
@ 2026-07-06  7:14 Krzysztof Kozlowski
  2026-07-06  7:21 ` sashiko-bot
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-06  7:14 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

DTS often have spaces after tabs in indentation for aligning continued
lines of comments or list properties, thus allow such cases to avoid
many false positives.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
 scripts/dtc/dt-check-style | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
index 2d5723d41ea3..6d02d045f92d 100755
--- a/scripts/dtc/dt-check-style
+++ b/scripts/dtc/dt-check-style
@@ -365,8 +365,13 @@ def check_mixed_indent_chars(ctx):
             continue
         if dl.linetype == LineType.PREPROCESSOR:
             continue
-        if ' ' in dl.indent_str and '\t' in dl.indent_str:
-            yield (dl.lineno, 'mixed tabs and spaces in indent')
+        if ctx.indent_kind == 'spaces':
+            if ' ' in dl.indent_str and '\t' in dl.indent_str:
+                yield (dl.lineno, 'mixed tabs and spaces in indent')
+        else:
+            # Spaces are used to align indentation in comments or continued lines
+            if dl.indent_str.count(' ') > 7:
+                yield (dl.lineno, 'too many space characters in indent (more than 7)')
 
 
 def detect_indent_unit(ctx):
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-06  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06  7:14 [PATCH] dtc: dt-check-style: Allow space-aligning indentation in DTS Krzysztof Kozlowski
2026-07-06  7:21 ` sashiko-bot
2026-07-06  7:26   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox