public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jordan Justen <jordan.l.justen@intel.com>
To: Yonghong Zhu <yonghong.zhu@intel.com>,  edk2-devel@lists.01.org
Cc: "Liming Gao" <liming.gao@intel.com>
Subject: Re: [Patch 3/3] BaseTools: Update PatchCheck to report error for EFI_D_*
Date: Mon, 17 Oct 2016 09:58:17 -0700	[thread overview]
Message-ID: <147672349716.943.1214729718045230847@jljusten-ivb> (raw)
In-Reply-To: <1476692918-10716-4-git-send-email-yonghong.zhu@intel.com>

On 2016-10-17 01:28:38, Yonghong Zhu wrote:
> In EDK2, DEBUG_* is recommended to be used instead of EFI_D_*. For new
> code, they should use DEBUG_* macro.
> 
> Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=145
>

Remove blank line. I think you meant 143, not 145.

Instead of looking for DEBUG and EFI_D_, I think we should just look
for EFI_D_. It is possible that the user might put the EFI_D_ on a
separate line. What do you think?

Should we add 'warning' support to the script first, and then flag
this as a warning rather than an error? (I don't think this is too
important, because getting an error from the script will not currently
prevent the patch from being merged.)

-Jordan

> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
>  BaseTools/Scripts/PatchCheck.py | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
> index 05f8f6e..3ac0769 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -337,10 +337,15 @@ class GitDiffCheck:
>          if self.hunk_filename is not None:
>              lines.append('File: ' + self.hunk_filename)
>          lines.append('Line: ' + line)
>  
>          self.error(*lines)
> +
> +    DEBUG_macro_re = re.compile(r'''^
> +                                    \s*DEBUG\s*\(\(
> +                                ''',
> +                                re.VERBOSE)
>  
>      def check_added_line(self, line):
>          eol = ''
>          for an_eol in self.line_endings:
>              if line.endswith(an_eol):
> @@ -354,10 +359,13 @@ class GitDiffCheck:
>                                    line)
>          if '    ' in line:
>              self.added_line_error('Tab character used', line)
>          if len(stripped) < len(line):
>              self.added_line_error('Trailing whitespace found', line)
> +        if self.DEBUG_macro_re.match(line):
> +            if 'EFI_D_' in line:
> +                self.added_line_error('EFI_D_* format is used, recommend to use DEBUG_* format', line)
>  
>      split_diff_re = re.compile(r'''
>                                     (?P<cmd>
>                                         ^ diff \s+ --git \s+ a/.+ \s+ b/.+ $
>                                     )
> -- 
> 2.6.1.windows.1
> 


  reply	other threads:[~2016-10-17 16:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17  8:28 [Patch 0/3] BaseTools: PatchCheck to align with wiki and report error for EFI_D_* Yonghong Zhu
2016-10-17  8:28 ` [Patch 1/3] BaseTools: Update PatchCheck for max length of subject and message line Yonghong Zhu
2016-10-17 16:40   ` Jordan Justen
2016-10-18  0:49     ` Zhu, Yonghong
2016-10-17  8:28 ` [Patch 2/3] BaseTools: Update PatchCheck to handle the two [] as prefix Yonghong Zhu
2016-10-17 16:48   ` Jordan Justen
2016-10-18  0:53     ` Zhu, Yonghong
2016-10-17  8:28 ` [Patch 3/3] BaseTools: Update PatchCheck to report error for EFI_D_* Yonghong Zhu
2016-10-17 16:58   ` Jordan Justen [this message]
2016-10-18  2:02     ` Zhu, Yonghong
2016-10-18  6:43       ` Jordan Justen
2016-10-18 10:22         ` Zhu, Yonghong

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=147672349716.943.1214729718045230847@jljusten-ivb \
    --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