From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 150F81A1E86 for ; Mon, 17 Oct 2016 01:29:08 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP; 17 Oct 2016 01:29:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,356,1473145200"; d="scan'208";a="773482784" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.144]) by FMSMGA003.fm.intel.com with ESMTP; 17 Oct 2016 01:29:07 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao , Jordan Justen Date: Mon, 17 Oct 2016 16:28:38 +0800 Message-Id: <1476692918-10716-4-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 In-Reply-To: <1476692918-10716-1-git-send-email-yonghong.zhu@intel.com> References: <1476692918-10716-1-git-send-email-yonghong.zhu@intel.com> Subject: [Patch 3/3] BaseTools: Update PatchCheck to report error for EFI_D_* X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 08:29:08 -0000 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 Cc: Liming Gao Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu --- 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 '\t' 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 ^ diff \s+ --git \s+ a/.+ \s+ b/.+ $ ) -- 2.6.1.windows.1