[binutils-gdb] [pre-commit] Don't require text type for codespell hook

Tom de Vries vries@sourceware.org
Tue Aug 25 12:48:35 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bec8230435edac7b75bae3c60800ebb249ebe180

commit bec8230435edac7b75bae3c60800ebb249ebe180
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Aug 25 14:48:26 2026 +0200

    [pre-commit] Don't require text type for codespell hook
    
    Codespell's .pre-commit-hooks.yaml sets "types: [text]".
    
    Override this using "types: [file]", to make the codespell hook see the same
    files as codespell usage outside pre-commit:
    ...
    $ codespell --toml gdb/pyproject.toml gdb*
    ...
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34411

Diff:
---
 .pre-commit-config.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a4a94b0a16f..53e4c5033c1 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -86,6 +86,11 @@ repos:
         entry: gdb/contrib/codespell-log.sh
         args: *codespell_args
         additional_dependencies: *codespell_deps
+        # Override the [text] setting in .pre-commit-hooks.yaml, allowing this
+        # hook to see the same files as codespell usage outside pre-commit.
+        # Instead, filter files in gdb/pyproject.toml.
+        types: &types_default [file]
+        types_or: &types_or_default []
         verbose: true
         stages: [commit-msg]


More information about the Binutils-cvs mailing list