mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-29 01:04:14 -04:00
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:
committed by
Rob Herring (Arm)
parent
c6fa876d86
commit
49b5cf461d
@@ -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),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user