All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Daniel Golle" <daniel@makrotopia.org>
Cc: conor+dt@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3 3/3] dt-bindings: add self-test fixtures for style checker
Date: Mon, 11 May 2026 23:11:17 +0000	[thread overview]
Message-ID: <20260511231118.3084BC2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <963a1a0a46cccf924f44243534852db13083692b.1778454442.git.daniel@makrotopia.org>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The test runner script `run.sh` uses bash-specific process substitution (`<()`) but specifies `#!/bin/sh` as the interpreter.
- [Medium] The test runner script `run.sh` ignores the exit status of the `dt-check-style` tool, contradicting its own documented requirements.
--

commit 395b561606d87e6d15dae9a82c1d4e309bfe406d
Author: Daniel Golle <daniel@makrotopia.org>

dt-bindings: add self-test fixtures for style checker

This commit provides good and bad DTS and YAML fixtures along with a test
runner to verify the behavior of dt-check-style. It also wires this up to a
new top-level make target, dt_style_selftest.

> diff --git a/scripts/dtc/dt-style-selftest/run.sh b/scripts/dtc/dt-style-selftest/run.sh
> new file mode 100755
> index 0000000000000..821d635ddc151
> --- /dev/null
> +++ b/scripts/dtc/dt-style-selftest/run.sh
> @@ -0,0 +1,67 @@
> +#!/bin/sh

Since this script specifies /bin/sh, which on systems like Debian and Ubuntu
points to dash, will this cause a syntax error when evaluating the
bash-specific process substitution used later in the script?

> +# SPDX-License-Identifier: GPL-2.0-only
> +#
> +# Run dt-check-style against fixtures under good/ and bad/.
> +# good/ files must produce no output and exit 0 in both modes.
> +# bad/ files must produce the expected output (in expected/<name>.txt)
> +# and exit 1.

[ ... ]

> +for f in "$here"/good/*; do
> +    [ -e "$f" ] || continue
> +    for mode in relaxed strict; do
> +        out=$(run "$f" "$mode") || true

Does ignoring the exit status here and below conflict with the requirements
documented at the top of the script?

By appending || true, the script seems to rely only on the output string
matching. This would allow tests to silently pass even if dt-check-style
exits with an incorrect code or crashes entirely.

[ ... ]

> +for f in "$here"/bad/*; do

[ ... ]

> +    out=$(run "$f" "$mode") || true
> +    # Strip the directory prefix so expected files are portable.
> +    out=$(printf '%s\n' "$out" | sed "s|$here/bad/|bad/|g")
> +    if [ "$out" != "$body" ]; then
> +        echo "FAIL bad/$mode: $name:"
> +        diff -u <(printf '%s\n' "$body") <(printf '%s\n' "$out") | \

Can this process substitution syntax <() cause a fatal syntax error on
systems where /bin/sh is a strict POSIX shell?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1778454442.git.daniel@makrotopia.org?part=3

      reply	other threads:[~2026-05-11 23:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-10 23:58 [PATCH v3 0/3] dt-bindings: automated coding style check for DTS examples Daniel Golle
2026-05-10 23:58 ` [PATCH v3 1/3] dt-bindings: add DTS style checker Daniel Golle
2026-05-11 22:36   ` sashiko-bot
2026-05-10 23:58 ` [PATCH v3 2/3] dt-bindings: wire style checker into dt_binding_check Daniel Golle
2026-05-11 23:06   ` sashiko-bot
2026-05-10 23:59 ` [PATCH v3 3/3] dt-bindings: add self-test fixtures for style checker Daniel Golle
2026-05-11 23:11   ` sashiko-bot [this message]

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=20260511231118.3084BC2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.