From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"rebecca@bsdio.com" <rebecca@bsdio.com>,
"Gao, Liming" <gaoliming@byosoft.com.cn>,
"Feng, Bob C" <bob.c.feng@intel.com>,
"Chen, Christine" <yuwei.chen@intel.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH v2 1/1] BaseTools: Update PatchCheck.py to check for __FUNCTION__
Date: Thu, 13 Apr 2023 16:38:04 +0000 [thread overview]
Message-ID: <CO1PR11MB49298C3260F3FF61CA21C9BCD2989@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230413151600.308196-1-rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Rebecca Cran
> Sent: Thursday, April 13, 2023 8:16 AM
> To: devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Feng, Bob C
> <bob.c.feng@intel.com>; Chen, Christine <yuwei.chen@intel.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Subject: [edk2-devel] [PATCH v2 1/1] BaseTools: Update PatchCheck.py to check for __FUNCTION__
>
> New code should use the C99 macro __func__ instead of the pre-Standard
> macro __FUNCTION__. Update PatchCheck.py to reject patches with the
> latter.
>
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
> BaseTools/Scripts/PatchCheck.py | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
> index 5d17d99a12ef..900226f18fe5 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -491,6 +491,12 @@ class GitDiffCheck:
> 'but DEBUG_' + mo.group(1) +
> ' is now recommended', line)
>
> + rp_file = os.path.realpath(self.filename)
> + rp_script = os.path.realpath(__file__)
> + if line.find('__FUNCTION__') != -1 and rp_file != rp_script:
> + self.added_line_error('__FUNCTION__ was used, but __func__ '
> + 'is now recommended', line)
> +
> split_diff_re = re.compile(r'''
> (?P<cmd>
> ^ diff \s+ --git \s+ a/.+ \s+ b/.+ $
> --
> 2.34.1
>
>
>
>
>
prev parent reply other threads:[~2023-04-13 16:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-13 15:16 [PATCH v2 1/1] BaseTools: Update PatchCheck.py to check for __FUNCTION__ Rebecca Cran
2023-04-13 16:38 ` Michael D Kinney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CO1PR11MB49298C3260F3FF61CA21C9BCD2989@CO1PR11MB4929.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox