summaryrefslogtreecommitdiff
path: root/BaseTools/Scripts
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2019-04-04 15:35:07 -0700
committerMichael D Kinney <michael.d.kinney@intel.com>2019-04-09 11:26:28 -0700
commita281361014de51cffb6cac1a516f045eddf9f571 (patch)
tree1a724bc2b4fa35aa8b8f7782b688980aab6108f8 /BaseTools/Scripts
parent3806e1fd139775610d8f2e7541a916c3a91ad989 (diff)
BaseTools/PatchCheck: Generate error if Contributed-under found
https://bugzilla.tianocore.org/show_bug.cgi?id=1655 With the change to BSD+Patent License, the TianoCore Contributor's Agreement has been removed and as a result, a Contributed-under tag is no longer appropriate in patches. Remove the check for the TianoCore Contributor's Agreement and instead, generate an error if a patch contains a Contributed-under tag in the commit message. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'BaseTools/Scripts')
-rwxr-xr-xBaseTools/Scripts/PatchCheck.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index dfc43b4274..6aec15d0f0 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 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -67,14 +67,17 @@ class CommitMessageCheck:
print(prefix, line)
count += 1
+ # Find 'contributed-under:' at the start of a line ignoring case and
+ # requires ':' to be present. Matches if there is white space before
+ # the tag or between the tag and the ':'.
+ contributed_under_re = \
+ re.compile(r'^\s*contributed-under\s*:', re.MULTILINE|re.IGNORECASE)
+
def check_contributed_under(self):
- cu_msg='Contributed-under: TianoCore Contribution Agreement 1.1'
- if self.msg.find(cu_msg) < 0:
- # Allow 1.0 for now while EDK II community transitions to 1.1
- cu_msg='Contributed-under: TianoCore Contribution Agreement 1.0'
- if self.msg.find(cu_msg) < 0:
- self.error('Missing Contributed-under! (Note: this must be ' +
- 'added by the code contributor!)')
+ match = self.contributed_under_re.search(self.msg)
+ if match is not None:
+ self.error('Contributed-under! (Note: this must be ' +
+ 'removed by the code contributor!)')
@staticmethod
def make_signature_re(sig, re_input=False):