Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC 0/2] [pre-commit] Require codespell-clean commit messages
@ 2026-07-25  9:02 Tom de Vries
  2026-07-25  9:02 ` [RFC 1/2] [gdb] Ignore codespell errors followed by sic marker Tom de Vries
  2026-07-25  9:02 ` [RFC 2/2] [pre-commit] Require codespell-clean commit messages Tom de Vries
  0 siblings, 2 replies; 3+ messages in thread
From: Tom de Vries @ 2026-07-25  9:02 UTC (permalink / raw)
  To: gdb-patches

The first patch adds ignoring intentional missppellings using '[sic]', for
instance in a sentence "Fixed typo skippig [sic]".

The second patch updates the codespell-log pre-commit hook to require
codespell-clean commit messages.

Tom de Vries (2):
  [gdb] Ignore codespell errors followed by sic marker
  [pre-commit] Require codespell-clean commit messages

 .pre-commit-config.yaml      |  2 --
 gdb/contrib/codespell-log.sh | 20 --------------------
 gdb/pyproject.toml           |  2 ++
 3 files changed, 2 insertions(+), 22 deletions(-)
 delete mode 100755 gdb/contrib/codespell-log.sh


base-commit: 1f17a093ff10f290cef9c736223bfbf86e132be7
-- 
2.51.0


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

* [RFC 1/2] [gdb] Ignore codespell errors followed by sic marker
  2026-07-25  9:02 [RFC 0/2] [pre-commit] Require codespell-clean commit messages Tom de Vries
@ 2026-07-25  9:02 ` Tom de Vries
  2026-07-25  9:02 ` [RFC 2/2] [pre-commit] Require codespell-clean commit messages Tom de Vries
  1 sibling, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2026-07-25  9:02 UTC (permalink / raw)
  To: gdb-patches

Codespell v2.4.3 introduced off-by-default --ignore-sic, allowing to ignore
intentional typos relatively easily by following them with a sic [1] marker:
'[sic]'.

Enable it, for use in gdb source files and commit messages.

[1] https://en.wikipedia.org/wiki/Sic
---
 gdb/pyproject.toml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/pyproject.toml b/gdb/pyproject.toml
index 80a106b7183..011f92e1ac2 100644
--- a/gdb/pyproject.toml
+++ b/gdb/pyproject.toml
@@ -152,3 +152,5 @@ 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
+
+ignore-sic = true
-- 
2.51.0


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

* [RFC 2/2] [pre-commit] Require codespell-clean commit messages
  2026-07-25  9:02 [RFC 0/2] [pre-commit] Require codespell-clean commit messages Tom de Vries
  2026-07-25  9:02 ` [RFC 1/2] [gdb] Ignore codespell errors followed by sic marker Tom de Vries
@ 2026-07-25  9:02 ` Tom de Vries
  1 sibling, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2026-07-25  9:02 UTC (permalink / raw)
  To: gdb-patches

Now that we have an easy method to ignore intentional typos in commit
messages:
...
Fix typo skippig [sic].
...
require commit messages to be codespell-clean.

Still, this may mean that large blocks of verbatim text (for instance
backtraces) might have to be ignored using
codespell:ignore-begin/codespell:ignore-end.

To restart editing after check failure, this command can be used:
...
$ git commit --amend
  <codespell-log check failure>
$ git commit --amend -F .git/COMMIT_EDITMSG -e
...

Having your commit abort is somewhat annoying, and I thought of two ways to
make this less annoying:
- add an interactive loop that allows the user to re-edit or ignore the
  codespell failure
- in case of codespell failure, add codespell:ignore-begin codespell:ignore-end
  around the entire message, and pass
---
 .pre-commit-config.yaml      |  2 --
 gdb/contrib/codespell-log.sh | 20 --------------------
 2 files changed, 22 deletions(-)
 delete mode 100755 gdb/contrib/codespell-log.sh

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 60164e446fc..76991b7d18a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -87,9 +87,7 @@ repos:
       files: &gdb_files '^(gdb|gdbserver|gdbsupport)/'
     - id: codespell
       name: codespell-log
-      entry: gdb/contrib/codespell-log.sh
       args: *codespell_args
-      verbose: true
       stages: [commit-msg]
 
   # Tclint hooks.
diff --git a/gdb/contrib/codespell-log.sh b/gdb/contrib/codespell-log.sh
deleted file mode 100755
index 3e1fc26159a..00000000000
--- a/gdb/contrib/codespell-log.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2025-2026 Free Software Foundation, Inc.
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Script to be used as commit-msg hook to spell-check the commit log using
-# codespell.
-
-codespell "$@" || true
-- 
2.51.0


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

end of thread, other threads:[~2026-07-25  9:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-25  9:02 [RFC 0/2] [pre-commit] Require codespell-clean commit messages Tom de Vries
2026-07-25  9:02 ` [RFC 1/2] [gdb] Ignore codespell errors followed by sic marker Tom de Vries
2026-07-25  9:02 ` [RFC 2/2] [pre-commit] Require codespell-clean commit messages 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