]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/Check.py
BaseTools: Align include guards policy
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / Check.py
index 6087abfa4d8d61756270cc8cd52e7456d6a7e73b..7a012617fd357cfe75ee1938d1cbc0efce9a4dbc 100644 (file)
@@ -1,6 +1,7 @@
 ## @file\r
 # This file is used to define checkpoints used by ECC tool\r
 #\r
+# Copyright (c) 2021, Arm Limited. All rights reserved.<BR>\r
 # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>\r
 # SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
@@ -1438,7 +1439,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[-1] != '_':\r
+                if Name[0] == '_' or Name[-1] != '_' or Name[-2] == '_':\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