From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 7D6CE21A04822 for ; Mon, 10 Apr 2017 22:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491889782; x=1523425782; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=qA8GwOY8BGKuQZ7dgBh/fFj209tkRnpW53lEVXQeyko=; b=U9sdBOvEBq2FAXntKuadjAheze7S8Sz9JZ3LMDtCWfe1MOlWxLNuDo5i oRLwfegdKMVByxO9zffqqPYw6TCJ/Q==; Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2017 22:49:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,184,1488873600"; d="scan'208";a="76050204" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 10 Apr 2017 22:49:10 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 10 Apr 2017 22:49:09 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.178]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.117]) with mapi id 14.03.0319.002; Tue, 11 Apr 2017 13:49:07 +0800 From: "Wu, Hao A" To: "Chen, Hesheng" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [patch] BaseTools/ECC: Change check rule for Ifndef statement Thread-Index: AQHSsaY3QUOo7V1RCUqEBQT1570gvaG/qdgg Date: Tue, 11 Apr 2017 05:49:07 +0000 Message-ID: References: <1491793038-58972-1-git-send-email-hesheng.chen@intel.com> In-Reply-To: <1491793038-58972-1-git-send-email-hesheng.chen@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Tue, 11 Apr 2017 05:49:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao Wu Also tested upon codes in MdePkg\Library\BaseLib, the reported issues for '#ifndef DISABLE_NEW_DEPRECATED_INTERFACES' used in file MdePkg\Library\BaseLib\String.c now go away. Best Regards, Hao Wu > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > hesschen > Sent: Monday, April 10, 2017 10:57 AM > To: edk2-devel@lists.01.org > Subject: [edk2] [patch] BaseTools/ECC: Change check rule for Ifndef state= ment >=20 > Remove the check of Ifndef statement on .c files, only check on .h > files. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: hesschen > --- > BaseTools/Source/Python/Ecc/Check.py | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) >=20 > 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 = BSD > License > # which accompanies this distribution. The full text of the license may= be > found at > @@ -941,7 +941,7 @@ class Check(object): >=20 > # Check Guid Format in module INF > def MetaDataFileCheckModuleFileGuidFormat(self): > - if EccGlobalData.gConfig.MetaDataFileCheckModuleFileGuidFormat o= r > EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or > EccGlobalData.gConfig.CheckAll =3D=3D '1': > + if EccGlobalData.gConfig.MetaDataFileCheckModuleFileGuidFormat = =3D=3D > '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or > EccGlobalData.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.MetaDataFileCheckModuleFileProtocolForm= at > or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or > EccGlobalData.gConfig.CheckAll =3D=3D '1': > + if EccGlobalData.gConfig.MetaDataFileCheckModuleFileProtocolForm= at > =3D=3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or > EccGlobalData.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 > EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or > EccGlobalData.gConfig.CheckAll =3D=3D '1': > + if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePpiFormat = =3D=3D '1' > or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or > EccGlobalData.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 > EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or > EccGlobalData.gConfig.CheckAll =3D=3D '1': > + if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePcdFormat = =3D=3D '1' > or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or > EccGlobalData.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(FileTa= ble) > self.NamingConventionCheckTypedefStatement(FileT= able) > - self.NamingConventionCheckIfndefStatement(FileTa= ble) > self.NamingConventionCheckVariableName(FileTable= ) > self.NamingConventionCheckSingleCharacterVariabl= e(FileTable) > + if os.path.splitext(F)[1] in ('.h'): > + self.NamingConventionCheckIfndefStatement(Fi= leTable) >=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 bot= h prefix > and postfix underscore characters, '_'. > def NamingConventionCheckIfndefStatement(self, FileTable): > - if EccGlobalData.gConfig.NamingConventionCheckTypedefStatement = =3D=3D > '1' or EccGlobalData.gConfig.NamingConventionCheckAll =3D=3D '1' or > EccGlobalData.gConfig.CheckAll =3D=3D '1': > + if EccGlobalData.gConfig.NamingConventionCheckIfndefStatement = =3D=3D '1' > or EccGlobalData.gConfig.NamingConventionCheckAll =3D=3D '1' or > EccGlobalData.gConfig.CheckAll =3D=3D '1': > EdkLogger.quiet("Checking naming covention of #ifndef statem= ent ...") >=20 > SqlCommand =3D """select ID, Value from %s where Model =3D %= s""" % > (FileTable, MODEL_IDENTIFIER_MACRO_IFNDEF) > -- > 2.7.2.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel