Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH] dtc: dt-check-style: Allow space-aligning indentation in DTS
Date: Mon, 06 Jul 2026 07:21:29 +0000	[thread overview]
Message-ID: <20260706072129.965D31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706071446.87669-2-krzysztof.kozlowski@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The relaxed indentation check in `check_mixed_indent_chars` permits the 'space before tab' anti-pattern.
- [Low] Docstring and rule registry description contradict the new code behavior.
--

commit 097e3ef5e7d164bd1c9be0d6781e53f6f27aaa64
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Subject: dtc: dt-check-style: Allow space-aligning indentation in DTS

This commit relaxes the DTS style checking to allow spaces after tabs in
indentation. This is intended to permit space-aligning for continued lines
of comments or list properties.

> diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style
> index 2d5723d41ea39..6d02d045f92d1 100755
> --- a/scripts/dtc/dt-check-style
> +++ b/scripts/dtc/dt-check-style
> @@ -365,8 +365,13 @@ def check_mixed_indent_chars(ctx):

[Severity: Low]
Does the docstring for check_mixed_indent_chars() need to be updated?

The new implementation explicitly allows mixing spaces and tabs in DTS files up
to 7 spaces, which contradicts the assertion in the docstring that they can
never be mixed on one line. This contradiction also applies to the rule
registry description further down in the file.

>              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:

[Severity: Low]
Does this condition properly enforce the "spaces after tabs" intent mentioned
in the commit message?

By only checking if the total space count exceeds 7, the code appears to still
allow "space before tab" combinations, provided the total number of spaces is 7
or fewer. Could this lead to invalid indentation slipping through the style
checker?

> +                yield (dl.lineno, 'too many space characters in indent (more than 7)')
>  
>  
>  def detect_indent_unit(ctx):

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260706071446.87669-2-krzysztof.kozlowski@oss.qualcomm.com?part=1

  reply	other threads:[~2026-07-06  7:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-07-06  7:26   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260706072129.965D31F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox