From 2649a735b249e54a4ddd7bd2b8d62bfe77e8d6da Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daud? Date: Thu, 2 Jan 2020 20:16:56 +0800 Subject: [PATCH] BaseTools/PatchCheck.py: Ignore CR and LF characters in subject length REF: https://bugzilla.tianocore.org/show_bug.cgi?id=113 Strip the trailing characters before checking the subject line is less than 72 characters. Fixes: e61406708c83f Cc: Liming Gao Cc: Jordan Justen Reviewed-by: Jordan Justen Reviewed-by: Bob Feng Signed-off-by: Philippe Mathieu-Daude --- BaseTools/Scripts/PatchCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 2a4e6f603e..9668025798 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -196,7 +196,7 @@ class CommitMessageCheck: self.error('Empty commit message!') return - if count >= 1 and len(lines[0]) >= 72: + if count >= 1 and len(lines[0].rstrip()) >= 72: self.error('First line of commit message (subject line) ' + 'is too long.')