From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/9] [gdb] Increase clean range in check-whitespace-pre-commit.py
Date: Thu, 18 Jun 2026 15:38:10 +0200 [thread overview]
Message-ID: <20260618133818.55460-2-tdevries@suse.de> (raw)
In-Reply-To: <20260618133818.55460-1-tdevries@suse.de>
The list of files completely checked by check-whitespace-pre-commit.py is
determined by this regexp:
...
re_clean = re.compile(
"(^(gdb/testsuite/|gdbsupport/|gdbserver/)|[.](m4|ac|def|[chly])$|NEWS)"
)
...
Turn this around, and add a todo list of files not completely whitespace clean
yet, enabling complete checking for all other files.
---
.pre-commit-config.yaml | 1 +
gdb/contrib/check-whitespace-pre-commit.py | 32 +++++++++++++++++++---
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 141451501ed..9910bbb82f2 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -117,6 +117,7 @@ repos:
language: unsupported_script
entry: gdb/contrib/check-whitespace-pre-commit.py
files: '^(gdb(support|server)?)/.*$'
+ types: ['text']
- id: &id3 pre-commit-setup
name: *id3
language: python
diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index 128727d2ca6..fb4e4b8f537 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -18,15 +18,39 @@ import re
import subprocess
import sys
-re_clean = re.compile(
- "(^(gdb/testsuite/|gdbsupport/|gdbserver/)|[.](m4|ac|def|[chly])$|NEWS)"
-)
+# Files to completely ignore.
+re_ignore = re.compile("ChangeLog")
+
+# Files that are not clean, so they're only checked when changes.
+todo_list = [
+ "gdb/config/djgpp/fnchange.lst",
+ "gdb/contrib/ari/create-web-ari-in-src.sh",
+ "gdb/gdb-gdb.gdb.in",
+ "gdb/config/djgpp/djcheck.sh",
+ "gdb/contrib/ari/gdb_ari.sh",
+ "gdb/features/sparc/sparc64-cp0.xml",
+ "gdb/features/sparc/sparc64-fpu.xml",
+ "gdb/configure.tgt",
+ "gdb/doc/annotate.texinfo",
+ "gdb/features/aarch64-pauth.xml",
+ "gdb/features/sparc/sparc32-fpu.xml",
+ "gdb/features/s390-core64.xml",
+ "gdb/features/sparc/sparc32-cp0.xml",
+ "gdb/config/djgpp/README",
+ "gdb/exc_request.defs",
+ "gdb/doc/refcard.tex",
+ "gdb/doc/stack_frame.txt",
+ "gdb/features/library-list-aix.dtd",
+]
clean = []
other = []
for f in sys.argv[1:]:
- m = re_clean.search(f)
+ m = re_ignore.search(f)
if m:
+ continue
+
+ if f not in todo_list:
clean.append(f)
else:
other.append(f)
--
2.51.0
next prev parent reply other threads:[~2026-06-18 13:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
2026-06-18 13:38 ` Tom de Vries [this message]
2026-06-18 13:38 ` [PATCH 2/9] [gdb] Fix leftover conflict marker in gdb/config/djgpp/README Tom de Vries
2026-06-18 13:38 ` [PATCH 3/9] [gdb] Fix new blank line at EOF in a few scripts Tom de Vries
2026-06-18 13:38 ` [PATCH 4/9] [gdb] Fix new blank line at EOF in a few xml files Tom de Vries
2026-06-18 13:38 ` [PATCH 5/9] [gdb] Ignore whitespace in imported file gdb/exc_request.defs Tom de Vries
2026-06-18 13:38 ` [PATCH 6/9] [gdb] Fix trailing whitespace in some files Tom de Vries
2026-06-18 13:38 ` [PATCH 7/9] [gdb] Ignore trailing whitespace in gdb/gdb-gdb.gdb.in Tom de Vries
2026-06-18 13:38 ` [PATCH 8/9] [gdb] Fix trailing whitespace in annotate.texinfo Tom de Vries
2026-06-18 13:38 ` [PATCH 9/9] [gdb] Fix trailing whitespace in refcard.tex Tom de Vries
2026-06-18 14:03 ` [PATCH 0/9] [gdb] More whitespace fixes Eli Zaretskii
2026-06-18 15:25 ` Tom de Vries
2026-06-18 17:13 ` Tom Tromey
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=20260618133818.55460-2-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