From e7823338f0ed84c15c0e28e3ec4479d551a8eca9 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Tue, 1 Feb 2022 10:35:29 -0500 Subject: Allow whitespace at the start of non-wrapped trailers Sometimes folks indent their trailers with whitespace, so relax the rules to recognize this situation. In theory, this shouldn't introduce false-positives. Suggested-by: Rob Herring Link: https://lore.kernel.org/r/20211214214327.4003631-1-robh@kernel.org Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b4/__init__.py b/b4/__init__.py index 11c287e..0d506bb 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1397,7 +1397,7 @@ class LoreMessage: was_trailer = False for line in body.split('\n'): line = line.strip('\r') - matches = re.search(r'^(\w\S+):\s+(\S.*)', line, flags=re.I) + matches = re.search(r'^\s*(\w\S+):\s+(\S.*)', line, flags=re.I) if matches: groups = list(matches.groups()) # We only accept headers if we haven't seen any non-trailer lines -- cgit v1.2.3