summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Ecc
diff options
context:
space:
mode:
authorHess Chen <hess.chen@intel.com>2019-01-30 16:05:43 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-02-02 10:28:54 +0800
commitce3bfbec716a1d3667782f798f89b0eda423a4ea (patch)
tree8f841c69263751abeae276dd2dcf2706fa005008 /BaseTools/Source/Python/Ecc
parent5895f7f6d41591767f56d498d31a43a873bafe84 (diff)
downloadedk2-ce3bfbec716a1d3667782f798f89b0eda423a4ea.tar.gz
edk2-ce3bfbec716a1d3667782f798f89b0eda423a4ea.tar.bz2
edk2-ce3bfbec716a1d3667782f798f89b0eda423a4ea.zip
BaseTools/ECC: Add a new type of exception
Add a new type of exception for function body checkpoint. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hess.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Ecc')
-rw-r--r--BaseTools/Source/Python/Ecc/c.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py
index 50505c10fd..0c377c6c4a 100644
--- a/BaseTools/Source/Python/Ecc/c.py
+++ b/BaseTools/Source/Python/Ecc/c.py
@@ -1,7 +1,7 @@
## @file
# This file is used to be the c coding style checking of ECC tool
#
-# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -1511,7 +1511,7 @@ def CheckFuncLayoutBody(FullFileName):
FileTable = 'Identifier' + str(FileID)
Db = GetDB()
- SqlStatement = """ select BodyStartColumn, EndColumn, ID
+ SqlStatement = """ select BodyStartColumn, EndColumn, ID, Name
from Function
where BelongsToFile = %d
""" % (FileID)
@@ -1520,9 +1520,15 @@ def CheckFuncLayoutBody(FullFileName):
return ErrorMsgList
for Result in ResultSet:
if Result[0] != 0:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY, 'open brace should be at the very beginning of a line.', 'Function', Result[2])
+ if not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY, Result[3]):
+ PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY,
+ 'The open brace should be at the very beginning of a line for the function [%s].' % Result[3],
+ 'Function', Result[2])
if Result[1] != 0:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY, 'close brace should be at the very beginning of a line.', 'Function', Result[2])
+ if not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY, Result[3]):
+ PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY,
+ 'The close brace should be at the very beginning of a line for the function [%s].' % Result[3],
+ 'Function', Result[2])
def CheckFuncLayoutLocalVariable(FullFileName):
ErrorMsgList = []