From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id EE89074003E for ; Thu, 21 Dec 2023 08:33:23 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=5Q24Z3FsPTZnvrwpRReXBFACB3Eo8FNbLvdtan2IMuM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1703147602; v=1; b=qsjJGwrXxKan0QjKD/exzp/IrwZcXvIsCnV1yml4M832th4pP51fm24p938oDQSH8e3gPMkW Drh71wzlKNcYbCIK0+nLnC8l18wyzhJanwfzhtRtHpQ45fBinI93OGPcXvo7pXzFYCRFUBLn5xd zYY0zKqDG5wfOZrGMWJVfPpg= X-Received: by 127.0.0.2 with SMTP id QDpJYY7687511xAgI7fy5Evy; Thu, 21 Dec 2023 00:33:22 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.47593.1703147601813793516 for ; Thu, 21 Dec 2023 00:33:22 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B4CEF2F4; Thu, 21 Dec 2023 00:34:05 -0800 (PST) X-Received: from e126645.arm.com (unknown [10.57.47.165]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 74E3E3F738; Thu, 21 Dec 2023 00:33:19 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: Rebecca Cran , Liming Gao , Bob Feng , Yuwei Chen , Sami Mujawar , Pedro Falcato , Ray Ni Subject: [edk2-devel] [PATCH v2 1/1] BaseTools/Scripts/PatchCheck.py: Check for Change-id Date: Thu, 21 Dec 2023 09:32:50 +0100 Message-Id: <20231221083250.757575-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: C6kk7WAkaQMh2HN4R8l1ZnvQx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=qsjJGwrX; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Code review tools like gerrit might use a 'Change-id' tag to track the evolution of patches. This tag should be removed before submitting a patch to the mailing-list. It has been observed that contributors sometimes forget to remove this tag. Add a check in PatchCheck.py to automate this. Also add a '--ignore-change-id' command line parameter to ignore the above check. Signed-off-by: Pierre Gondois Acked-by: Pedro Falcato Reviewed-by: Yuwei Chen Reviewed-by: Rebecca Cran --- Notes: v2: - Fix capitalization in helper: Change-id -> Change-Id BaseTools/Scripts/PatchCheck.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck= .py index 7f372d40b570..1675dcbd7321 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -3,7 +3,7 @@ #=0D # Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
= =0D # Copyright (C) 2020, Red Hat, Inc.
=0D -# Copyright (c) 2020, ARM Ltd. All rights reserved.
=0D +# Copyright (c) 2020 - 2023, Arm Limited. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D @@ -26,6 +26,9 @@ class Verbose: SILENT, ONELINE, NORMAL =3D range(3)=0D level =3D NORMAL=0D =0D +class PatchCheckConf:=0D + ignore_change_id =3D False=0D +=0D class EmailAddressCheck:=0D """Checks an email address."""=0D =0D @@ -111,6 +114,8 @@ class CommitMessageCheck: self.check_signed_off_by()=0D self.check_misc_signatures()=0D self.check_overall_format()=0D + if not PatchCheckConf.ignore_change_id:=0D + self.check_change_id_format()=0D self.report_message_result()=0D =0D url =3D 'https://github.com/tianocore/tianocore.github.io/wiki/Commit-= Message-Format'=0D @@ -307,6 +312,12 @@ class CommitMessageCheck: break=0D last_sig_line =3D line.strip()=0D =0D + def check_change_id_format(self):=0D + cid=3D'Change-Id:'=0D + if self.msg.find(cid) !=3D -1:=0D + self.error('\"%s\" found in commit message:' % cid)=0D + return=0D +=0D (START, PRE_PATCH, PATCH) =3D range(3)=0D =0D class GitDiffCheck:=0D @@ -780,11 +791,16 @@ class PatchCheckApp: group.add_argument("--silent",=0D action=3D"store_true",=0D help=3D"Print nothing")=0D + group.add_argument("--ignore-change-id",=0D + action=3D"store_true",=0D + help=3D"Ignore the presence of 'Change-Id:' tag= s in commit message")=0D self.args =3D parser.parse_args()=0D if self.args.oneline:=0D Verbose.level =3D Verbose.ONELINE=0D if self.args.silent:=0D Verbose.level =3D Verbose.SILENT=0D + if self.args.ignore_change_id:=0D + PatchCheckConf.ignore_change_id =3D True=0D =0D if __name__ =3D=3D "__main__":=0D sys.exit(PatchCheckApp().retval)=0D --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112805): https://edk2.groups.io/g/devel/message/112805 Mute This Topic: https://groups.io/mt/103297083/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-