From: Simon Marchi <simark@simark.ca>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 2/3] [gdb] Use shfmt on regformats/regdat.sh
Date: Mon, 31 Aug 2026 16:13:49 -0400 [thread overview]
Message-ID: <8ff5061d-082c-4a00-90e4-31857e655027@simark.ca> (raw)
In-Reply-To: <20260830195315.1497894-3-tdevries@suse.de>
On 8/30/26 3:53 PM, Tom de Vries wrote:
> Run shfmt [1] on gdb/regformats/regdat.sh:
> ...
> $ shfmt \
> --language-dialect=posix \
> --indent=4 \
> --func-next-line \
> --space-redirects \
> --write \
> gdb/regformats/regdat.sh
It would be nice to have a script to easily do this on all our shell
scripts, which we could also run in the CI (like we run black to verify
the Python code formatting).
> ...
> followed by emacs whitespace-cleanup (because shfmt doesn't know about mixed
> tab/spaces indentation).
I guess said script would need to do this too (I wonder if it can be
done with sed, replacing leading groups of 8 spaces with a tab).
> Normalizes things like:
> ...
> if true
> then
> ...
> to:
> ...
> if true; then
> ...
> as suggested by Simon [2].
>
> Also:
> - makes sure statements are on their own line
> - removes double empty line
> - minor whitespace changes:
> - do_read () -> do_read()
> - cat <<EOF -> cat << EOF
>
> [1] https://github.com/mvdan/sh
> [2] https://sourceware.org/pipermail/gdb-patches/2026-August/229818.html
All the changes in the diff LGTM.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Simon
next prev parent reply other threads:[~2026-08-31 20:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 19:53 [PATCH v2 0/3] [gdb] Reformat regformats/regdat.sh Tom de Vries
2026-08-30 19:53 ` [PATCH v2 1/3] [gdb] Re-indent regformats/regdat.sh Tom de Vries
2026-08-31 20:09 ` Simon Marchi
2026-09-01 9:21 ` Tom de Vries
2026-08-30 19:53 ` [PATCH v2 2/3] [gdb] Use shfmt on regformats/regdat.sh Tom de Vries
2026-08-31 20:13 ` Simon Marchi [this message]
2026-09-02 13:21 ` Tom de Vries
2026-08-30 19:53 ` [PATCH v2 3/3] [gdb] Use shfmt --simplify " Tom de Vries
2026-08-31 20:14 ` Simon Marchi
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=8ff5061d-082c-4a00-90e4-31857e655027@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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