]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/Ecc: Update a checkpoint criteria.
authorHess Chen <hesheng.chen@intel.com>
Tue, 16 Oct 2018 05:49:35 +0000 (13:49 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Wed, 24 Oct 2018 00:41:04 +0000 (08:41 +0800)
Change the criteria of the checkpoint of "#ifndef" to remove the requirement of prefix '_'.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/Ecc/Check.py
BaseTools/Source/Python/Ecc/EccToolError.py

index 268e02126c1b1d433fb0fc730c3969ef607765d0..dfcc0302bc8b0637f324201ff33b9a75d1a5b15d 100644 (file)
@@ -1444,7 +1444,7 @@ class Check(object):
             RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)\r
             for Record in RecordSet:\r
                 Name = Record[1].replace('#ifndef', '').strip()\r
-                if Name[0] != '_' or Name[-1] != '_':\r
+                if Name[-1] != '_':\r
                     if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT, Name):\r
                         EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT, OtherMsg="The #ifndef name [%s] does not follow the rules" % (Name), BelongsToTable=FileTable, BelongsToItem=Record[0])\r
 \r
index 74f06bc4907f63311658012a6dafa7b8d243ac4d..7663e90d7e123d6b0b86e09e4aeeb99d456c2819 100644 (file)
@@ -169,7 +169,7 @@ gEccErrorMessage = {
     ERROR_NAMING_CONVENTION_CHECK_ALL : "",\r
     ERROR_NAMING_CONVENTION_CHECK_DEFINE_STATEMENT : "Only capital letters are allowed to be used for #define declarations",\r
     ERROR_NAMING_CONVENTION_CHECK_TYPEDEF_STATEMENT : "Only capital letters are allowed to be used for typedef declarations",\r
-    ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT : "The #ifndef at the start of an include file should use both prefix and postfix underscore characters, '_'",\r
+    ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT : "The #ifndef at the start of an include file should use a postfix underscore characters, '_'",\r
     ERROR_NAMING_CONVENTION_CHECK_PATH_NAME : """Path name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters""",\r
     ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME : """Variable name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters 4. Global variable name must start with a 'g'""",\r
     ERROR_NAMING_CONVENTION_CHECK_FUNCTION_NAME : """Function name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters""",\r