]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/PatchCheck.py: Update for max length of subject and message line
authorYonghong Zhu <yonghong.zhu@intel.com>
Mon, 17 Oct 2016 03:06:33 +0000 (11:06 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 20 Oct 2016 23:23:57 +0000 (07:23 +0800)
This patch update PatchCheck.py:
1. The subject line of the commit message should be < 72 characters.
2. The other lines of the commit message should be < 76 characters.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=113
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
BaseTools/Scripts/PatchCheck.py

index 455c1309b6d3c785adff3378172933844ac23d1c..07fca68149fe63e2a451e180a33d86599097889d 100755 (executable)
@@ -1,7 +1,7 @@
 ## @file\r
 #  Check a patch for various format issues\r
 #\r
-#  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials are licensed and made\r
 #  available under the terms and conditions of the BSD License which\r
@@ -16,7 +16,7 @@
 from __future__ import print_function\r
 \r
 VersionNumber = '0.1'\r
-__copyright__ = "Copyright (c) 2015, Intel Corporation  All rights reserved."\r
+__copyright__ = "Copyright (c) 2015 - 2016, Intel Corporation  All rights reserved."\r
 \r
 import email\r
 import argparse\r
@@ -197,7 +197,7 @@ class CommitMessageCheck:
             self.error('Empty commit message!')\r
             return\r
 \r
-        if count >= 1 and len(lines[0]) > 76:\r
+        if count >= 1 and len(lines[0]) >= 72:\r
             self.error('First line of commit message (subject line) ' +\r
                        'is too long.')\r
 \r
@@ -210,7 +210,7 @@ class CommitMessageCheck:
                        'empty.')\r
 \r
         for i in range(2, count):\r
-            if (len(lines[i]) > 76 and\r
+            if (len(lines[i]) >= 76 and\r
                 len(lines[i].split()) > 1 and\r
                 not lines[i].startswith('git-svn-id:')):\r
                 self.error('Line %d of commit message is too long.' % (i + 1))\r