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 1B85F7803E1 for ; Wed, 22 Nov 2023 13:15:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3L8w2K7VFNrZ2PuNJ0aie4YyZQmiAVF5DauoNwO+RXc=; 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=1700658917; v=1; b=X8R7fa/yCO2d6NI0ucdjd+R++koucYLw2Bpo8aU0q1/zTNHcL01i/gZU6K4UtzrxUZAgTh9r 91sPLMf7dVGdFnOG1W9nGSNMoOambyBee7S0MJMFSM0jWxkZ9UQ8IOqOlmfQaJJcBYjzudLRDjz Zj8zxi1hn1MzQJIexFDABQW4= X-Received: by 127.0.0.2 with SMTP id 0U72YY7687511xrqxoiOdrv4; Wed, 22 Nov 2023 05:15:17 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.18987.1700658916453027600 for ; Wed, 22 Nov 2023 05:15:17 -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 41DC61042; Wed, 22 Nov 2023 05:16:02 -0800 (PST) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4C3303F7A6; Wed, 22 Nov 2023 05:15:14 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: Rebecca Cran , Liming Gao , Bob Feng , Yuwei Chen , Sami Mujawar , YeoReum.Yun@arm.com Subject: [edk2-devel] [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for Change-id Date: Wed, 22 Nov 2023 14:14:44 +0100 Message-Id: <20231122131444.1885823-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: y16PjdCBu8lR73Kqf6SfiTdqx7686176AA= 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="X8R7fa/y"; 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 --- 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..7770d1e37318 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 (#111603): https://edk2.groups.io/g/devel/message/111603 Mute This Topic: https://groups.io/mt/102748141/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-