From: Yonghong Zhu Date: Mon, 17 Oct 2016 03:06:33 +0000 (+0800) Subject: BaseTools/PatchCheck.py: Update for max length of subject and message line X-Git-Tag: edk2-stable201903~5571 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=e61406708c83f96d3dc2e8899716cce43c058491 BaseTools/PatchCheck.py: Update for max length of subject and message line 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 Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Jordan Justen --- diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 455c1309b6..07fca68149 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -1,7 +1,7 @@ ## @file # Check a patch for various format issues # -# Copyright (c) 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
# # This program and the accompanying materials are licensed and made # available under the terms and conditions of the BSD License which @@ -16,7 +16,7 @@ from __future__ import print_function VersionNumber = '0.1' -__copyright__ = "Copyright (c) 2015, Intel Corporation All rights reserved." +__copyright__ = "Copyright (c) 2015 - 2016, Intel Corporation All rights reserved." import email import argparse @@ -197,7 +197,7 @@ class CommitMessageCheck: self.error('Empty commit message!') return - if count >= 1 and len(lines[0]) > 76: + if count >= 1 and len(lines[0]) >= 72: self.error('First line of commit message (subject line) ' + 'is too long.') @@ -210,7 +210,7 @@ class CommitMessageCheck: 'empty.') for i in range(2, count): - if (len(lines[i]) > 76 and + if (len(lines[i]) >= 76 and len(lines[i].split()) > 1 and not lines[i].startswith('git-svn-id:')): self.error('Line %d of commit message is too long.' % (i + 1))