From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web09.7481.1625716152976999038 for ; Wed, 07 Jul 2021 20:49:13 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: michael.d.kinney@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10038"; a="295075105" X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="295075105" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 20:49:10 -0700 X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="411198801" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.209.48.134]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 20:49:10 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [Patch 1/3] BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py Date: Wed, 7 Jul 2021 20:49:00 -0700 Message-Id: <20210708034902.1608-2-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.32.0.windows.1 In-Reply-To: <20210708034902.1608-1-michael.d.kinney@intel.com> References: <20210708034902.1608-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Mergify adds merge commits to a PR when processing PRs using the queue feature with auto rebase. Update PatchCheck.py to ignore commit message issues with these merge commits. These merge commits are not added to the base branch when the PR is merged by Mergify. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Michael D Kinney --- BaseTools/Scripts/PatchCheck.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 80754e763c5a..63e6223f8ebc 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 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
# Copyright (C) 2020, Red Hat, Inc.
# Copyright (c) 2020, ARM Ltd. All rights reserved.
# @@ -89,22 +89,28 @@ class EmailAddressCheck: class CommitMessageCheck: """Checks the contents of a git commit message.""" - def __init__(self, subject, message): + def __init__(self, subject, message, author_email): self.ok = True if subject is None and message is None: self.error('Commit message is missing!') return + MergifyMerge = False + if "mergify[bot]@users.noreply.github.com" in author_email: + if "Merge branch" in subject: + MergifyMerge = True + self.subject = subject self.msg = message print (subject) self.check_contributed_under() - self.check_signed_off_by() - self.check_misc_signatures() - self.check_overall_format() + if not MergifyMerge: + self.check_signed_off_by() + self.check_misc_signatures() + self.check_overall_format() self.report_message_result() url = 'https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format' @@ -522,7 +528,7 @@ class CheckOnePatch: email_check = EmailAddressCheck(self.author_email, 'Author') email_ok = email_check.ok - msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg) + msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg, self.author_email) msg_ok = msg_check.ok diff_ok = True -- 2.32.0.windows.1