]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/Ecc: Add a Configuration item
authorHess Chen <hesheng.chen@intel.com>
Thu, 25 Jun 2015 07:43:03 +0000 (07:43 +0000)
committerhchen30 <hchen30@Edk2>
Thu, 25 Jun 2015 07:43:03 +0000 (07:43 +0000)
Add a ‘SkipFileList’ in config.ini to exclude the files not be scanned.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: YangX Li <yangx.li@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17705 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/Source/Python/Ecc/Check.py
BaseTools/Source/Python/Ecc/Configuration.py
BaseTools/Source/Python/Ecc/c.py

index 5bee6dba7cdcd99cac7eb561d636310d4d9da0d4..da3b0fb9ac344573d03072be62703f6dd533374c 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define checkpoints used by ECC tool\r
 #\r
-# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2015, 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
@@ -100,6 +100,9 @@ class Check(object):
                         Dirnames.append(Dirname)\r
             if IgnoredPattern.match(Dirpath.upper()):\r
                 continue\r
+            for f in Filenames[:]:\r
+                if f.lower() in EccGlobalData.gConfig.SkipFileList:\r
+                    Filenames.remove(f)\r
             yield (Dirpath, Dirnames, Filenames)\r
 \r
     # Check whether return type exists and in the first line\r
index 3e54438e3e69b8197c563bd8f774fe6ab13edc09..55a1655ae5857c112be8a97a6c1f19e40cddb434 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define class Configuration\r
 #\r
-# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2015, 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
@@ -256,6 +256,9 @@ class Configuration(object):
 \r
         # The directory listed here will not be parsed, split with ','\r
         self.SkipDirList = []\r
+        \r
+        # The file listed here will not be parsed, split with ','\r
+        self.SkipFileList = []\r
 \r
         # A list for binary file ext name\r
         self.BinaryExtList = []\r
@@ -286,6 +289,8 @@ class Configuration(object):
                     continue\r
                 if List[0] == 'SkipDirList':\r
                     List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
+                if List[0] == 'SkipFileList':\r
+                    List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
                 if List[0] == 'BinaryExtList':\r
                     List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
                 self.__dict__[List[0]] = List[1]\r
index 6c20f6c9a3ff3d9d5288b6f0d56d23e7fad1ad1a..a25532af06b5ffde2ae39ba70bd1326bc8983c21 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 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2015, 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
@@ -514,6 +514,8 @@ def CollectSourceCodeDataIntoDB(RootDir):
                     dirnames.append(Dirname)\r
 \r
         for f in filenames:\r
+            if f.lower() in EccGlobalData.gConfig.SkipFileList:\r
+                continue\r
             collector = None\r
             FullName = os.path.normpath(os.path.join(dirpath, f))\r
             model = DataClass.MODEL_FILE_OTHERS\r