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 DF55F940F74 for ; Thu, 23 Nov 2023 02:12:13 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=aQ6WALcEdkYfFFdnH/4rwphc/g8IanNU6+SArC15i4s=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1700705532; v=1; b=hE5LVYFcuknykhC/KYWEiLXQ9noIxNZniZfiL9MFlMSLESn2ZeOhyaTafvGtASYmlB4YiqzM XczyRUEPWHyTJlTYVVjxTpmGrTZUa3OTobrjd738QRSManakxt5D92P6RoTzNKsdMt4SyzGZr2p oU2Dxjay5gfpXmTXhRLNDigA= X-Received: by 127.0.0.2 with SMTP id z4ruYY7687511xIG3IpDWlg2; Wed, 22 Nov 2023 18:12:12 -0800 X-Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com [209.85.221.172]) by mx.groups.io with SMTP id smtpd.web11.83177.1700705531995922628 for ; Wed, 22 Nov 2023 18:12:12 -0800 X-Received: by mail-vk1-f172.google.com with SMTP id 71dfb90a1353d-4ac42a20f35so89878e0c.2 for ; Wed, 22 Nov 2023 18:12:11 -0800 (PST) X-Gm-Message-State: zRe9GtPgyJLweXAPVIevWCjtx7686176AA= X-Google-Smtp-Source: AGHT+IFckNPS2cQKpTiCreMSr2V4O+eKr2F/IBnL12Ioan8OJVqQiIucBiWuKWl2GAz3vVk6CDRKzniD+puaCDXkniw= X-Received: by 2002:a67:ebd8:0:b0:462:71c3:99aa with SMTP id y24-20020a67ebd8000000b0046271c399aamr3881616vso.19.1700705530759; Wed, 22 Nov 2023 18:12:10 -0800 (PST) MIME-Version: 1.0 References: <20231122131444.1885823-1-pierre.gondois@arm.com> In-Reply-To: <20231122131444.1885823-1-pierre.gondois@arm.com> From: "Pedro Falcato" Date: Thu, 23 Nov 2023 02:11:59 +0000 Message-ID: Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for Change-id To: devel@edk2.groups.io, pierre.gondois@arm.com Cc: Rebecca Cran , Liming Gao , Bob Feng , Yuwei Chen , Sami Mujawar , YeoReum.Yun@arm.com 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,pedro.falcato@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" 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=hE5LVYFc; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.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 On Wed, Nov 22, 2023 at 1:15=E2=80=AFPM PierreGondois wrote: > > 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/PatchChe= ck.py > index 7f372d40b570..7770d1e37318 100755 > --- a/BaseTools/Scripts/PatchCheck.py > +++ b/BaseTools/Scripts/PatchCheck.py > @@ -3,7 +3,7 @@ > # > # Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved. > # Copyright (C) 2020, Red Hat, Inc.
> -# Copyright (c) 2020, ARM Ltd. All rights reserved.
> +# Copyright (c) 2020 - 2023, Arm Limited. All rights reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -26,6 +26,9 @@ class Verbose: > SILENT, ONELINE, NORMAL =3D range(3) > level =3D NORMAL > > +class PatchCheckConf: > + ignore_change_id =3D False > + > class EmailAddressCheck: > """Checks an email address.""" > > @@ -111,6 +114,8 @@ class CommitMessageCheck: > self.check_signed_off_by() > self.check_misc_signatures() > self.check_overall_format() > + if not PatchCheckConf.ignore_change_id: > + self.check_change_id_format() > self.report_message_result() > > url =3D 'https://github.com/tianocore/tianocore.github.io/wiki/Commi= t-Message-Format' > @@ -307,6 +312,12 @@ class CommitMessageCheck: > break > last_sig_line =3D line.strip() > > + def check_change_id_format(self): > + cid=3D'Change-Id:' > + if self.msg.find(cid) !=3D -1: > + self.error('\"%s\" found in commit message:' % cid) > + return > + > (START, PRE_PATCH, PATCH) =3D range(3) > > class GitDiffCheck: > @@ -780,11 +791,16 @@ class PatchCheckApp: > group.add_argument("--silent", > action=3D"store_true", > help=3D"Print nothing") > + group.add_argument("--ignore-change-id", > + action=3D"store_true", > + help=3D"Ignore the presence of 'Change-id:' t= ags in commit message") > self.args =3D parser.parse_args() > if self.args.oneline: > Verbose.level =3D Verbose.ONELINE > if self.args.silent: > Verbose.level =3D Verbose.SILENT > + if self.args.ignore_change_id: > + PatchCheckConf.ignore_change_id =3D True > > if __name__ =3D=3D "__main__": > sys.exit(PatchCheckApp().retval) > -- > 2.25.1 This is great, thanks! Acked-by: Pedro Falcato --=20 Pedro -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111642): https://edk2.groups.io/g/devel/message/111642 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-