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

Tom de Vries via Binutils-cvs <[email protected]>
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bec8230435edac7b75bae3c60800ebb249ebe180

commit bec8230435edac7b75bae3c60800ebb249ebe180
Author: Tom de Vries <[email protected]>
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]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.