Skip to content

Commit

Permalink
BaseTools/PatchCheck.py: Update for max length of subject and message…
Browse files Browse the repository at this point in the history
… 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 <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>
  • Loading branch information
Yonghong Zhu committed Oct 20, 2016
1 parent b752e8a commit e614067
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BaseTools/Scripts/PatchCheck.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @file
# Check a patch for various format issues
#
# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made
# available under the terms and conditions of the BSD License which
Expand All @@ -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
Expand Down Expand Up @@ -197,7 +197,7 @@ def check_overall_format(self):
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.')

Expand All @@ -210,7 +210,7 @@ def check_overall_format(self):
'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))
Expand Down

0 comments on commit e614067

Please sign in to comment.