* [PATCH] BaseTools/ECC: Add a new type of exception
@ 2019-01-30 8:49 Feng, Bob C
2019-02-02 1:14 ` Feng, Bob C
0 siblings, 1 reply; 2+ messages in thread
From: Feng, Bob C @ 2019-01-30 8:49 UTC (permalink / raw)
To: edk2-devel; +Cc: Hess Chen
From: Hess Chen <hess.chen@intel.com>
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>
---
BaseTools/Source/Python/Ecc/c.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py
index b8d6adde16..577d92744c 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 = []
--
2.14.2.windows.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] BaseTools/ECC: Add a new type of exception
2019-01-30 8:49 [PATCH] BaseTools/ECC: Add a new type of exception Feng, Bob C
@ 2019-02-02 1:14 ` Feng, Bob C
0 siblings, 0 replies; 2+ messages in thread
From: Feng, Bob C @ 2019-02-02 1:14 UTC (permalink / raw)
To: Feng, Bob C, edk2-devel@lists.01.org; +Cc: Chen, Hess
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Feng, Bob C
Sent: Wednesday, January 30, 2019 4:49 PM
To: edk2-devel@lists.01.org
Cc: Chen, Hess <hess.chen@intel.com>
Subject: [edk2] [PATCH] BaseTools/ECC: Add a new type of exception
From: Hess Chen <hess.chen@intel.com>
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>
---
BaseTools/Source/Python/Ecc/c.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py
index b8d6adde16..577d92744c 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 = []
--
2.14.2.windows.2
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-02 1:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-30 8:49 [PATCH] BaseTools/ECC: Add a new type of exception Feng, Bob C
2019-02-02 1:14 ` Feng, Bob C
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox