Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] [pre-commit] Add shellcheck
@ 2026-06-18 15:19 Tom de Vries
  2026-06-18 17:05 ` Simon Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2026-06-18 15:19 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-06-22 10:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-18 15:19 [PATCH] [pre-commit] Add shellcheck Tom de Vries
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox