Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH] [pre-commit] Add shellcheck
Date: Thu, 18 Jun 2026 17:19:57 +0200	[thread overview]
Message-ID: <20260618151957.76500-1-tdevries@suse.de> (raw)

I found a pure python implementation of shellcheck [1].

Use it to run shellcheck on scripts in the repo.

Exclude any scripts that are not currently clean.

Running it seems reasonably fast:
...
$ pre-commit run shellcheck --all-files -v
shellcheck...............................................................Passed
- hook id: shellcheck
- duration: 0.06s
...

For information on other solutions, see this RFC [2].

[1] https://pypi.org/project/pureshellcheck/0.2.2/
[2] https://sourceware.org/pipermail/gdb-patches/2024-November/213400.html
---
 .pre-commit-config.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 141451501ed..630f85b8127 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -129,3 +129,11 @@ repos:
       language: unsupported_script
       entry: gdb/contrib/check-file-mode.sh
       files: '^(gdb|gdbserver|gdbsupport)/.*$'
+    - id: &id5 shellcheck
+      name: *id5
+      language: python
+      additional_dependencies: ['pureshellcheck==0.2.2']
+      entry: pureshellcheck
+      files: '^(gdb|gdbsupport|gdbserver)/'
+      types: ['shell']
+      exclude: '^(gdb/config/djgpp/(djcheck.sh|djconfig.sh)|gdb/contrib/ari/(create-web-ari-in-src.sh|gdb_ari.sh|update-web-ari.sh)|gdb/contrib/(cc-with-tweaks.sh|expect-read1.sh|gdb-add-index.sh|license-check-new-files.sh)|gdb/gdb_buildall.sh|gdb/gdb_mbuild.sh|gdb/regformats/regdat.sh|gdb/syscalls/update-linux-from-src.sh|gdb/testsuite/make-check-all.sh|gdb/gcore-1.in|gdb/po/gdbtext|gdb/testsuite/lib/pdtrace.in)$|/configure$'

base-commit: 478b1846cdb82b776c8dcbec20ecd198297cd8ff
-- 
2.51.0


             reply	other threads:[~2026-06-18 15:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 15:19 Tom de Vries [this message]
2026-06-18 17:05 ` Simon Marchi
2026-06-19 11:19   ` Tom de Vries
2026-06-19 17:56     ` Simon Marchi
2026-06-22  8:58       ` Tom de Vries
2026-06-22  5:48   ` Thiago Jung Bauermann
2026-06-22 10:02     ` Tom de Vries

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=20260618151957.76500-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /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