From nobody Fri May 3 09:12:13 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1491793045761110.7685891548573; Sun, 9 Apr 2017 19:57:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 05EE421A04817; Sun, 9 Apr 2017 19:57:24 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 10DFF21A0480E for ; Sun, 9 Apr 2017 19:57:23 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 09 Apr 2017 19:57:22 -0700 Received: from tiano01.ccr.corp.intel.com ([10.239.9.111]) by FMSMGA003.fm.intel.com with ESMTP; 09 Apr 2017 19:57:21 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,180,1488873600"; d="scan'208";a="843953158" From: hesschen To: edk2-devel@lists.01.org Date: Mon, 10 Apr 2017 10:57:18 +0800 Message-Id: <1491793038-58972-1-git-send-email-hesheng.chen@intel.com> X-Mailer: git-send-email 2.7.2.windows.1 Subject: [edk2] [patch] BaseTools/ECC: Change check rule for Ifndef statement X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Remove the check of Ifndef statement on .c files, only check on .h files. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: hesschen Reviewed-by: Hao Wu Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/Ecc/Check.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python= /Ecc/Check.py index a22da3d..062120c 100644 --- a/BaseTools/Source/Python/Ecc/Check.py +++ b/BaseTools/Source/Python/Ecc/Check.py @@ -1,7 +1,7 @@ ## @file # This file is used to define checkpoints used by ECC tool # -# Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BS= D License # which accompanies this distribution. The full text of the license may b= e found at @@ -941,7 +941,7 @@ class Check(object): =20 # Check Guid Format in module INF def MetaDataFileCheckModuleFileGuidFormat(self): - if EccGlobalData.gConfig.MetaDataFileCheckModuleFileGuidFormat or = EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData.gCon= fig.CheckAll =3D=3D '1': + if EccGlobalData.gConfig.MetaDataFileCheckModuleFileGuidFormat =3D= =3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlob= alData.gConfig.CheckAll =3D=3D '1': EdkLogger.quiet("Check Guid Format in module INF ...") Table =3D EccGlobalData.gDb.TblInf SqlCommand =3D """ @@ -984,7 +984,7 @@ class Check(object): =20 # Check Protocol Format in module INF def MetaDataFileCheckModuleFileProtocolFormat(self): - if EccGlobalData.gConfig.MetaDataFileCheckModuleFileProtocolFormat= or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData.= gConfig.CheckAll =3D=3D '1': + if EccGlobalData.gConfig.MetaDataFileCheckModuleFileProtocolFormat= =3D=3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or Ecc= GlobalData.gConfig.CheckAll =3D=3D '1': EdkLogger.quiet("Check Protocol Format in module INF ...") Table =3D EccGlobalData.gDb.TblInf SqlCommand =3D """ @@ -1015,7 +1015,7 @@ class Check(object): =20 # Check Ppi Format in module INF def MetaDataFileCheckModuleFilePpiFormat(self): - if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePpiFormat or E= ccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData.gConf= ig.CheckAll =3D=3D '1': + if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePpiFormat =3D= =3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlob= alData.gConfig.CheckAll =3D=3D '1': EdkLogger.quiet("Check Ppi Format in module INF ...") Table =3D EccGlobalData.gDb.TblInf SqlCommand =3D """ @@ -1043,7 +1043,7 @@ class Check(object): =20 # Check Pcd Format in module INF def MetaDataFileCheckModuleFilePcdFormat(self): - if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePcdFormat or E= ccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData.gConf= ig.CheckAll =3D=3D '1': + if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePcdFormat =3D= =3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlob= alData.gConfig.CheckAll =3D=3D '1': EdkLogger.quiet("Check Pcd Format in module INF ...") Table =3D EccGlobalData.gDb.TblInf SqlCommand =3D """ @@ -1139,9 +1139,10 @@ class Check(object): FileTable =3D 'Identifier' + str(Id) self.NamingConventionCheckDefineStatement(FileTabl= e) self.NamingConventionCheckTypedefStatement(FileTab= le) - self.NamingConventionCheckIfndefStatement(FileTabl= e) self.NamingConventionCheckVariableName(FileTable) self.NamingConventionCheckSingleCharacterVariable(= FileTable) + if os.path.splitext(F)[1] in ('.h'): + self.NamingConventionCheckIfndefStatement(File= Table) =20 self.NamingConventionCheckPathName() self.NamingConventionCheckFunctionName() @@ -1183,7 +1184,7 @@ class Check(object): =20 # Check whether the #ifndef at the start of an include file uses both = prefix and postfix underscore characters, '_'. def NamingConventionCheckIfndefStatement(self, FileTable): - if EccGlobalData.gConfig.NamingConventionCheckTypedefStatement =3D= =3D '1' or EccGlobalData.gConfig.NamingConventionCheckAll =3D=3D '1' or Ecc= GlobalData.gConfig.CheckAll =3D=3D '1': + if EccGlobalData.gConfig.NamingConventionCheckIfndefStatement =3D= =3D '1' or EccGlobalData.gConfig.NamingConventionCheckAll =3D=3D '1' or Ecc= GlobalData.gConfig.CheckAll =3D=3D '1': EdkLogger.quiet("Checking naming covention of #ifndef statemen= t ...") =20 SqlCommand =3D """select ID, Value from %s where Model =3D %s"= "" % (FileTable, MODEL_IDENTIFIER_MACRO_IFNDEF) --=20 2.7.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel