aboutsummaryrefslogtreecommitdiff
path: root/gdb/contrib/check-whitespace-pre-commit.py
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2025-12-10 00:25:20 +0100
committerTom de Vries <tdevries@suse.de>2025-12-10 00:25:20 +0100
commitea97136badfb06c607bf498151f8510b733b51d8 (patch)
treef90c3f9f4b5318134f8b692afe04964898a5ee0e /gdb/contrib/check-whitespace-pre-commit.py
parent21b10d4c3e687ecdc4738900269d75691e67def7 (diff)
downloadbinutils-ea97136badfb06c607bf498151f8510b733b51d8.zip
binutils-ea97136badfb06c607bf498151f8510b733b51d8.tar.gz
binutils-ea97136badfb06c607bf498151f8510b733b51d8.tar.bz2
[gdb] Fix whitespace in NEWS
Fix this: ... $ empty=$(git hash-object -t tree /dev/null) $ git diff-index --check $empty gdb/NEWS gdb/NEWS:1874: space before tab in indent. + [--basename | --dirname] ... and add the file to the clean list in gdb/contrib/check-whitespace-pre-commit.py. [ I'm not sure if NEWS has an official style. There are no settings for NEWS in .gitattributes, so the whitespace attribute defaults to trailing-space (shorthand for blank-at-eol, blank-at-eof) and space-before-tab. We could require either spaces only (tab-in-indent) in gdb/.gitattributes: ... NEWS whitespace=space-before-tab,tab-in-indent,trailing-space ... or tab style (indent-with-non-tab): ... NEWS whitespace=space-before-tab,indent-with-non-tab,trailing-space ... For tab-in-indent, we get: ... $ git diff-index --check $empty gdb/NEWS | wc -l 228 ... and for indent-with-non-tab instead: ... $ git diff-index --check $empty gdb/NEWS | wc -l 40 ... so the more common style seems to be tab style. But I'm leaving this as is for now. ]
Diffstat (limited to 'gdb/contrib/check-whitespace-pre-commit.py')
-rwxr-xr-xgdb/contrib/check-whitespace-pre-commit.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index d7fa45d..9d82f77 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -19,7 +19,7 @@ import subprocess
import sys
re_clean = re.compile(
- "(^(gdb/testsuite/|gdbsupport/|gdbserver/)|[.](m4|ac|def|[chly])$)"
+ "(^(gdb/testsuite/|gdbsupport/|gdbserver/)|[.](m4|ac|def|[chly])$|NEWS)"
)
re_clean_exclude = re.compile("^(gdb/symfile.c|gdb/cli/cli-cmds.c)$")