[PATCH] [pre-commit] Avoid tabs in .pre-commit-config.yaml

Tom de Vries <[email protected]> Thu, 30 Jul 2026 15:05:34 +0200
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
When editing .pre-commit-config.yaml with emacs, I tend to get tab-indented
lines, which causes:
...
$ git commit -a
An error has occurred: InvalidConfigError:
==> File .pre-commit-config.yaml
=====> while scanning for the next token
found character that cannot start any token
  in "<unicode string>", line 150, column 1
...

Fix this by adding a "Local Variables" section.
---
 .pre-commit-config.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 8ff84dae274..3795746c6a9 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -147,3 +147,8 @@ repos:
         language: unsupported_script
         entry: gdb/contrib/check-file-mode.sh
         files: *gdb_files
+
+# Local Variables:
+# indent-tabs-mode: nil
+# tab-width: 2
+# End:

base-commit: d1268210b6f6eddd267a4ebe4b7d36b802af628d
-- 
2.51.0