]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/c.py
Update ECC to support more doxygen keywords
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / c.py
index 256b9e021c265d5a12a74b8fe32114873c720f11..d7b95984385a2e2155968dd7ca123c0a63e3ec14 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to be the c coding style checking of ECC tool\r
 #\r
-# Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -1568,7 +1568,7 @@ def CheckMemberVariableFormat(Name, Value, FileTable, TdId, ModelId):
     Fields = Value[LBPos + 1 : RBPos]\r
     Fields = StripComments(Fields).strip()\r
     NestPos = Fields.find ('struct')\r
-    if NestPos != -1 and (NestPos + len('struct') < len(Fields)):\r
+    if NestPos != -1 and (NestPos + len('struct') < len(Fields)) and ModelId != DataClass.MODEL_IDENTIFIER_UNION:\r
         if not Fields[NestPos + len('struct') + 1].isalnum():\r
             if not EccGlobalData.gException.IsException(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE, Name):\r
                 PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE, 'Nested struct in [%s].' % (Name), FileTable, TdId)\r
@@ -2216,7 +2216,8 @@ def CheckDoxygenCommand(FullFileName):
                        where Model = %d or Model = %d\r
                    """ % (FileTable, DataClass.MODEL_IDENTIFIER_COMMENT, DataClass.MODEL_IDENTIFIER_FUNCTION_HEADER)\r
     ResultSet = Db.TblFile.Exec(SqlStatement)\r
-    DoxygenCommandList = ['bug', 'todo', 'example', 'file', 'attention', 'param', 'post', 'pre', 'retval', 'return', 'sa', 'since', 'test', 'note', 'par']\r
+    DoxygenCommandList = ['bug', 'todo', 'example', 'file', 'attention', 'param', 'post', 'pre', 'retval',\r
+                          'return', 'sa', 'since', 'test', 'note', 'par', 'endcode', 'code']\r
     for Result in ResultSet:\r
         CommentStr = Result[0]\r
         CommentPartList = CommentStr.split()\r
@@ -2228,6 +2229,10 @@ def CheckDoxygenCommand(FullFileName):
             if Part.startswith('@'):\r
                 if EccGlobalData.gException.IsException(ERROR_DOXYGEN_CHECK_COMMAND, Part):\r
                     continue\r
+                if not Part.replace('@', '').strip():\r
+                    continue\r
+                if Part.lstrip('@') in ['{', '}']:\r
+                    continue\r
                 if Part.lstrip('@').isalpha():\r
                     if Part.lstrip('@') not in DoxygenCommandList:\r
                         PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'Unknown doxygen command %s' % Part, FileTable, Result[1])\r