From bd80de2148fc150b539a5f2d8e09c08f1ede90ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Wed, 3 Sep 2025 15:29:50 +0200 Subject: [PATCH] Fix: Display commit message as ASCII on error --- hooks/check-message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/check-message.py b/hooks/check-message.py index 96d8c0d..5edeb8e 100755 --- a/hooks/check-message.py +++ b/hooks/check-message.py @@ -40,12 +40,12 @@ # Check trailing whitespace if l != l.rstrip(): - sys.stderr.write("*** Message contains trailing whitespace: '{}'\n".format(l)) + sys.stderr.write("*** Message contains trailing whitespace: {!a}\n".format(l)) sys.exit(1) # Check ASCII, and no control chars if any(ord(c) < 32 or ord(c) > 127 for c in l): - sys.stderr.write("*** Message contains non-ASCII characters or tabs: '{}'\n".format(l)) + sys.stderr.write("*** Message contains non-ASCII characters or tabs: {!a}\n".format(l)) sys.exit(1) # Check first line