dirnames.append(Dirname)\r
\r
for f in filenames:\r
+ collector = None\r
FullName = os.path.normpath(os.path.join(dirpath, f))\r
+ model = DataClass.MODEL_FILE_OTHERS\r
if os.path.splitext(f)[1] in ('.h', '.c'):\r
EdkLogger.info("Parsing " + FullName)\r
model = f.endswith('c') and DataClass.MODEL_FILE_C or DataClass.MODEL_FILE_H\r
collector.CleanFileProfileBuffer()\r
collector.ParseFileWithClearedPPDirective()\r
# collector.PrintFragments()\r
- BaseName = os.path.basename(f)\r
- DirName = os.path.dirname(FullName)\r
- Ext = os.path.splitext(f)[1].lstrip('.')\r
- ModifiedTime = os.path.getmtime(FullName)\r
- FileObj = DataClass.FileClass(-1, BaseName, Ext, DirName, FullName, model, ModifiedTime, GetFunctionList(), GetIdentifierList(), [])\r
- FileObjList.append(FileObj)\r
+ BaseName = os.path.basename(f)\r
+ DirName = os.path.dirname(FullName)\r
+ Ext = os.path.splitext(f)[1].lstrip('.')\r
+ ModifiedTime = os.path.getmtime(FullName)\r
+ FileObj = DataClass.FileClass(-1, BaseName, Ext, DirName, FullName, model, ModifiedTime, GetFunctionList(), GetIdentifierList(), [])\r
+ FileObjList.append(FileObj)\r
+ if collector:\r
collector.CleanFileProfileBuffer()\r
\r
if len(ParseErrorFileList) > 0:\r
\r
Db = GetDB()\r
for file in FileObjList:\r
- Db.InsertOneFile(file)\r
+ if file.ExtName.upper() not in ['INF', 'DEC', 'DSC', 'FDF']:\r
+ Db.InsertOneFile(file)\r
\r
Db.UpdateIdentifierBelongsToFunction()\r
\r
from File\r
where FullPath like '%s'\r
""" % FullFileName\r
-\r
ResultSet = Db.TblFile.Exec(SqlStatement)\r
\r
FileID = -1\r
return FileID\r
\r
def GetIncludeFileList(FullFileName):\r
+ if os.path.splitext(FullFileName)[1].upper() not in ('.H'):\r
+ return []\r
IFList = IncludeFileListDict.get(FullFileName)\r
if IFList != None:\r
return IFList\r
FileTable = 'Identifier' + str(FileID)\r
SqlStatement = """ select Value, ID\r
from %s\r
- where Model = %d and StartLine = 1 and StartColumn = 0\r
+ where Model = %d and (StartLine = 1 or StartLine = 7 or StartLine = 8) and StartColumn = 0\r
""" % (FileTable, DataClass.MODEL_IDENTIFIER_COMMENT)\r
ResultSet = Db.TblFile.Exec(SqlStatement)\r
if len(ResultSet) == 0:\r
PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'No Comment appear at the very beginning of file.', 'File', FileID)\r
return ErrorMsgList\r
\r
+ IsFoundError1 = True\r
+ IsFoundError2 = True\r
+ IsFoundError3 = True\r
for Result in ResultSet:\r
- CommentStr = Result[0]\r
- if not CommentStr.startswith('/** @file'):\r
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FILE_HEADER, 'File header comment should begin with ""/** @file""', FileTable, Result[1])\r
- if not CommentStr.endswith('**/'):\r
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment should end with **/', FileTable, Result[1])\r
- if CommentStr.find('.') == -1:\r
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMENT_DESCRIPTION, 'Comment description should end with period \'.\'', FileTable, Result[1])\r
+ CommentStr = Result[0].strip()\r
+ ID = Result[1]\r
+ if CommentStr.startswith('/** @file'):\r
+ IsFoundError1 = False\r
+ if CommentStr.endswith('**/'):\r
+ IsFoundError2 = False\r
+ if CommentStr.find('.') != -1:\r
+ IsFoundError3 = False\r
+\r
+ if IsFoundError1:\r
+ PrintErrorMsg(ERROR_DOXYGEN_CHECK_FILE_HEADER, 'File header comment should begin with ""/** @file""', FileTable, ID)\r
+ if IsFoundError2:\r
+ PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment should end with ""**/""', FileTable, ID)\r
+ if IsFoundError3:\r
+ PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMENT_DESCRIPTION, 'Comment description should end with period "".""', FileTable, ID)\r
\r
def CheckFuncHeaderDoxygenComments(FullFileName):\r
ErrorMsgList = []\r