Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] [gdb] Document word regexp choice in pyproject.toml
@ 2026-09-04 17:39 Tom de Vries
  2026-09-04 17:39 ` [PATCH 2/2] [gdb] Fix some typos Tom de Vries
  0 siblings, 1 reply; 4+ messages in thread
From: Tom de Vries @ 2026-09-04 17:39 UTC (permalink / raw)
  To: gdb-patches

The codespell tool has an option regex that can be used to control what it
considered a word.

An open question is whether dropping dash or underscore from that regexp is a
good tradeoff in terms of amount of true and false positives.

Document this issue in detail in pyproject.toml.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34241
---
 gdb/pyproject.toml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gdb/pyproject.toml b/gdb/pyproject.toml
index 47704bb0048..32f14f13f3e 100644
--- a/gdb/pyproject.toml
+++ b/gdb/pyproject.toml
@@ -151,3 +151,13 @@ ignore-multiline-regex = 'codespell:ignore-begin.*?codespell:ignore-end'
 # Add 1 (disable warnings about wrong encoding) in addition to the default
 # 2+32 to skip warnings about iso-8859-1 encoded files.
 quiet-level = 35 # 1+2+32
+
+# For regex we currently use the default value, which since v2.2.6 corresponds
+# to: regex = '''[A-Za-z0-9_'’-]+''' .
+#
+# Dropping the underscore or dash exposes us to more true and false positives.
+# It remains to be seen whether that's a good tradeoff.
+#
+# A related issue ( https://github.com/codespell-project/codespell/issues/1508
+# ) is the fact that using a non-default regex is not compatible with -w, which
+# is a convenient way to fix codespell errors.

base-commit: 881f1e8384b69f2dcf832b29eb7cf8fe7a1fae1a
-- 
2.51.0


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

* [PATCH 2/2] [gdb] Fix some typos
  2026-09-04 17:39 [PATCH 1/2] [gdb] Document word regexp choice in pyproject.toml Tom de Vries
@ 2026-09-04 17:39 ` Tom de Vries
  2026-09-04 19:45   ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Tom de Vries @ 2026-09-04 17:39 UTC (permalink / raw)
  To: gdb-patches

Detect typos in words containing dashes by enabling the regex field in the
codespell configuration in pyproject, and dropping the dash.

Fix some typos manually (not using codespell -w).

This also triggers codespell to work on the rules in
gdb/contrib/codespell-dictionary.txt, so skip it.
---
 gdb/doc/gdb.texinfo                          | 2 +-
 gdb/doc/guile.texi                           | 2 +-
 gdb/pyproject.toml                           | 2 ++
 gdb/testsuite/gdb.base/charset.exp           | 2 +-
 gdb/testsuite/gdb.base/source-nofile.gdb     | 2 +-
 gdb/testsuite/gdb.base/source.exp            | 6 +++---
 gdb/testsuite/gdb.cp/local-static.exp        | 2 +-
 gdb/testsuite/gdb.mi/mi-dprintf-modified.exp | 2 +-
 gdb/testsuite/gdb.opt/break-on-_exit.exp     | 2 +-
 9 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 0030698dcee..c7cfca13233 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -3827,7 +3827,7 @@ program information from the perspective of the current thread.
 
 @cindex @code{New} @var{systag} message
 @cindex thread identifier (system)
-@c FIXME-implementors!! It would be more helpful if the [New...] message
+@c FIXME-implementers!! It would be more helpful if the [New...] message
 @c included GDB's numeric thread handle, so you could just go to that
 @c thread without first checking `info threads'.
 Whenever @value{GDBN} detects a new thread in your program, it displays
diff --git a/gdb/doc/guile.texi b/gdb/doc/guile.texi
index 03f1008d20f..95f83802f23 100644
--- a/gdb/doc/guile.texi
+++ b/gdb/doc/guile.texi
@@ -3340,7 +3340,7 @@ Return @code{#t} if @var{object} is an object of type @code{<gdb:lazy-string>}.
 Otherwise return @code{#f}.
 @end deffn
 
-@deffn {Scheme Procedure} lazy-string-address lazy-sring
+@deffn {Scheme Procedure} lazy-string-address lazy-string
 Return the address of @var{lazy-string}.
 @end deffn
 
diff --git a/gdb/pyproject.toml b/gdb/pyproject.toml
index 32f14f13f3e..aacb181d807 100644
--- a/gdb/pyproject.toml
+++ b/gdb/pyproject.toml
@@ -72,6 +72,8 @@ skip = [
 'gdb/aclocal.m4',
 'gdbserver/aclocal.m4',
 'gdbsupport/aclocal.m4',
+# Skip codespell files containing typos.
+'gdb/contrib/codespell-dictionary.txt',
 # TODO:
 # codespell:ignore-begin.  Ignore slite and endianity.
 'gdb/testsuite/config/slite.exp',
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index 13e874ec955..9995021dabc 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -522,7 +522,7 @@ foreach val {0 1 2 3 4 5 6 7 8 9 a b c d e f} {
 # Tests for wide- or unicode- strings.  L is the prefix letter to use,
 # either "L" (for wide strings), "u" (for UTF-16), or "U" (for UTF-32).
 # NAME is used in the test names and should be related to the prefix
-# letter in some easy-to-undestand way.
+# letter in some easy-to-understand way.
 proc test_wide_or_unicode {L name} {
     gdb_test "print $L\"ab\" $L\"c\"" " = $L\"abc\"" \
       "basic $name string concatenation"
diff --git a/gdb/testsuite/gdb.base/source-nofile.gdb b/gdb/testsuite/gdb.base/source-nofile.gdb
index 58ec3b0f64b..242db9a86c5 100644
--- a/gdb/testsuite/gdb.base/source-nofile.gdb
+++ b/gdb/testsuite/gdb.base/source-nofile.gdb
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-source for-sure-nonexistant-file
+source for-sure-nonexistent-file
 
 # Just print an message to confirm that failing to source the file
 # did not cause this script to abort.
diff --git a/gdb/testsuite/gdb.base/source.exp b/gdb/testsuite/gdb.base/source.exp
index 04e13e8ec96..9595041b408 100644
--- a/gdb/testsuite/gdb.base/source.exp
+++ b/gdb/testsuite/gdb.base/source.exp
@@ -56,11 +56,11 @@ gdb_test "source -v -s ./source-test.gdb" \
 # Test sourcing a non-existent file, both when the source command
 # comes from the a command entered at the GDB prompt, and when
 # it comes from a script being sourced.
-gdb_test "source for-sure-nonexistant-file" \
-	 "for-sure-nonexistant-file: No such file or directory\."
+gdb_test "source for-sure-nonexistent-file" \
+	 "for-sure-nonexistent-file: No such file or directory\."
 
 gdb_test "source source-nofile.gdb" \
-	 "warning: for-sure-nonexistant-file: No such file or directory\.\[\r\n\]*source error not fatal"
+	 "warning: for-sure-nonexistent-file: No such file or directory\.\[\r\n\]*source error not fatal"
 
 
 # Test commands that error out in sourced files, including in nested sourced
diff --git a/gdb/testsuite/gdb.cp/local-static.exp b/gdb/testsuite/gdb.cp/local-static.exp
index ca9fd7b911e..3ccb721eb8c 100644
--- a/gdb/testsuite/gdb.cp/local-static.exp
+++ b/gdb/testsuite/gdb.cp/local-static.exp
@@ -250,7 +250,7 @@ proc do_test {lang} {
     }
 
     # Now run to each function, and print its variables using the
-    # localy-visible name.
+    # locally-visible name.
     foreach scope_line $scopes_list {
 	set scope [lindex $scope_line 0]
 	set var_prefix [lindex $scope_line 1]
diff --git a/gdb/testsuite/gdb.mi/mi-dprintf-modified.exp b/gdb/testsuite/gdb.mi/mi-dprintf-modified.exp
index 726a71a6c10..641c4c552ae 100644
--- a/gdb/testsuite/gdb.mi/mi-dprintf-modified.exp
+++ b/gdb/testsuite/gdb.mi/mi-dprintf-modified.exp
@@ -18,7 +18,7 @@
 #
 # GDB use to emit a 'breakpoint-modified' dprintf breakpoints each
 # time the dprintf_breakpoint::re_set function was called as this
-# would re-cacluate the dprintf command string, even though in most
+# would re-calculate the dprintf command string, even though in most
 # cases the calculated string was no different from the previous
 # value.
 #
diff --git a/gdb/testsuite/gdb.opt/break-on-_exit.exp b/gdb/testsuite/gdb.opt/break-on-_exit.exp
index 9caa54e4ad8..7f1e2ada240 100644
--- a/gdb/testsuite/gdb.opt/break-on-_exit.exp
+++ b/gdb/testsuite/gdb.opt/break-on-_exit.exp
@@ -28,7 +28,7 @@
 # We may get the required setup in case of a libc with missing separate
 # debuginfo, but we want the same effect if that debuginfo is installed.
 #
-# So, we use -readnever to read minimal symbols, but not non-miminal symbols.
+# So, we use -readnever to read minimal symbols, but not non-minimal symbols.
 #
 # Because the code at _exit may be and usually is optimized, the test is in
 # the gdb.opt directory.
-- 
2.51.0


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

* Re: [PATCH 2/2] [gdb] Fix some typos
  2026-09-04 17:39 ` [PATCH 2/2] [gdb] Fix some typos Tom de Vries
@ 2026-09-04 19:45   ` Eli Zaretskii
  2026-09-09 11:49     ` Tom de Vries
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2026-09-04 19:45 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

> From: Tom de Vries <tdevries@suse.de>
> Date: Fri,  4 Sep 2026 19:39:33 +0200
> 
> Detect typos in words containing dashes by enabling the regex field in the
> codespell configuration in pyproject, and dropping the dash.
> 
> Fix some typos manually (not using codespell -w).
> 
> This also triggers codespell to work on the rules in
> gdb/contrib/codespell-dictionary.txt, so skip it.

Typo fixes fall under the "obvious fix" rule, and don't need any
approvals.

Thanks.

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

* Re: [PATCH 2/2] [gdb] Fix some typos
  2026-09-04 19:45   ` Eli Zaretskii
@ 2026-09-09 11:49     ` Tom de Vries
  0 siblings, 0 replies; 4+ messages in thread
From: Tom de Vries @ 2026-09-09 11:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On 9/4/26 9:45 PM, Eli Zaretskii wrote:
>> From: Tom de Vries <tdevries@suse.de>
>> Date: Fri,  4 Sep 2026 19:39:33 +0200
>>
>> Detect typos in words containing dashes by enabling the regex field in the
>> codespell configuration in pyproject, and dropping the dash.
>>
>> Fix some typos manually (not using codespell -w).
>>
>> This also triggers codespell to work on the rules in
>> gdb/contrib/codespell-dictionary.txt, so skip it.
> 
> Typo fixes fall under the "obvious fix" rule, and don't need any
> approvals.
> 

Hi Eli,

True.

I was mostly interested in review of the first patch, and the commit 
message of this patch references the first patch, so I submitted it as a 
series rather than just applying it.

Anyway, I've pushed this series.

Thanks,
- Tom

> Thanks.


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

end of thread, other threads:[~2026-09-09 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-04 17:39 [PATCH 1/2] [gdb] Document word regexp choice in pyproject.toml Tom de Vries
2026-09-04 17:39 ` [PATCH 2/2] [gdb] Fix some typos Tom de Vries
2026-09-04 19:45   ` Eli Zaretskii
2026-09-09 11:49     ` 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