diff options
author | Rebecca Cran <rebecca@bsdio.com> | 2023-04-06 17:36:32 -0600 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-04-14 13:15:19 +0000 |
commit | c9fb11f92f52e06bcb1279b467a3b2667757be44 (patch) | |
tree | 68fbe209435e165b00850ea772944ffec8740aa9 /BaseTools/Scripts | |
parent | 55b67b6950e648338adfe8ec54aeb26ed89d2c97 (diff) | |
download | edk2-c9fb11f92f52e06bcb1279b467a3b2667757be44.zip edk2-c9fb11f92f52e06bcb1279b467a3b2667757be44.tar.gz edk2-c9fb11f92f52e06bcb1279b467a3b2667757be44.tar.bz2 |
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>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'BaseTools/Scripts')
-rwxr-xr-x | BaseTools/Scripts/PatchCheck.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 5d17d99..900226f 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/.+ $
|