dtc: dt-check-style: Narrow disallowing of tab in DTS only to YAML

DTS in the bindings (example in a YAML file) does not have tabs at all,
but regular DTS do, therefore entire check check_tab_in_dts() has
confusing name and should apply only to YAML files.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260709-dts-style-checker-v5-1-fcc147cb697d@oss.qualcomm.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
This commit is contained in:
Krzysztof Kozlowski
2026-07-09 19:41:29 +02:00
committed by Rob Herring (Arm)
parent c6fa876d86
commit 49b5cf461d
3 changed files with 6 additions and 6 deletions

View File

@@ -340,7 +340,7 @@ def check_trailing_whitespace(ctx):
yield (dl.lineno, 'trailing whitespace')
def check_tab_in_dts(ctx):
def check_tab_in_yaml_example(ctx):
"""Reject literal tabs in DTS lines when input is YAML.
For YAML examples, indent and content must use spaces. Tabs inside
@@ -927,9 +927,9 @@ RULES = [
Rule('trailing-whitespace', 'relaxed',
'no trailing whitespace on any line',
check_trailing_whitespace),
Rule('tab-in-dts', 'relaxed',
'YAML examples may not contain tab characters',
check_tab_in_dts, applies_to=('yaml',)),
Rule('tab-in-yaml', 'relaxed',
'YAML (also DTS examples) may not contain tab characters',
check_tab_in_yaml_example, applies_to=('yaml',)),
Rule('mixed-indent-chars', 'relaxed',
'indent must not mix tabs and spaces',
check_mixed_indent_chars),

View File

@@ -1,3 +1,3 @@
# mode=relaxed
bad/yaml-mixed-indent.yaml:27: example 0 [mixed-indent-chars] mixed tabs and spaces in indent
bad/yaml-mixed-indent.yaml:27: example 0 [tab-in-dts] tab character not allowed in DTS example
bad/yaml-mixed-indent.yaml:27: example 0 [tab-in-yaml] tab character not allowed in DTS example

View File

@@ -1,2 +1,2 @@
# mode=relaxed
bad/yaml-tab.yaml:28: example 0 [tab-in-dts] tab character not allowed in DTS example
bad/yaml-tab.yaml:28: example 0 [tab-in-yaml] tab character not allowed in DTS example