]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/PatchCheck.py: Ignore CR and LF characters in subject length
authorPhilippe Mathieu-Daud? <philmd@redhat.com>
Thu, 2 Jan 2020 12:16:56 +0000 (20:16 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 9 Jan 2020 06:09:33 +0000 (06:09 +0000)
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 <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
BaseTools/Scripts/PatchCheck.py

index 2a4e6f603e79a7ffeaad694d11756150b4ca00ec..9668025798da2ba0a3523ad3bb3b017a348b2343 100755 (executable)
@@ -196,7 +196,7 @@ class CommitMessageCheck:
             self.error('Empty commit message!')\r
             return\r
 \r
-        if count >= 1 and len(lines[0]) >= 72:\r
+        if count >= 1 and len(lines[0].rstrip()) >= 72:\r
             self.error('First line of commit message (subject line) ' +\r
                        'is too long.')\r
 \r