addons: /reportErrorCli/reportError/
This commit is contained in:
parent
0cc2b5ca14
commit
97157046f7
|
@ -21,7 +21,7 @@ def reportError(token, severity, msg, id):
|
|||
if VERIFY:
|
||||
VERIFY_ACTUAL.append(str(token.linenr) + ':cert-' + id)
|
||||
else:
|
||||
cppcheckdata.reportErrorCli(token, severity, msg, 'cert', id)
|
||||
cppcheckdata.reportError(token, severity, msg, 'cert', id)
|
||||
|
||||
def simpleMatch(token, pattern):
|
||||
for p in pattern.split(' '):
|
||||
|
|
|
@ -797,9 +797,11 @@ def ArgumentParser():
|
|||
return parser
|
||||
|
||||
|
||||
def reportErrorCli(location, severity, message, addon, errorId):
|
||||
def reportError(location, severity, message, addon, errorId):
|
||||
if '--cli' in sys.argv:
|
||||
errout = sys.stdout
|
||||
loc = '[%s:%i:%i]' % (location.file, location.linenr, location.col)
|
||||
else:
|
||||
errout = sys.errout
|
||||
errout.write('[%s:%i:%i] (%s) %s [%s-%s]\n' % (location.file, location.linenr, location.col, severity, message, addon, errorId))
|
||||
loc = '[%s:%i]' % (location.file, location.linenr)
|
||||
errout.write('%s (%s) %s [%s-%s]\n' % (loc, severity, message, addon, errorId))
|
||||
|
|
|
@ -38,4 +38,4 @@ for arg in sys.argv[1:]:
|
|||
if typetok.str == 'void':
|
||||
continue
|
||||
|
||||
cppcheckdata.reportErrorCli(token, 'information', 'found a cast', 'findcasts', 'cast')
|
||||
cppcheckdata.reportError(token, 'information', 'found a cast', 'findcasts', 'cast')
|
||||
|
|
|
@ -21,7 +21,7 @@ def reportError(token, severity, msg, id):
|
|||
if VERIFY:
|
||||
VERIFY_ACTUAL.append(str(token.linenr) + ':' + id)
|
||||
else:
|
||||
cppcheckdata.reportErrorCli(token, severity, msg, 'misc', id)
|
||||
cppcheckdata.reportError(token, severity, msg, 'misc', id)
|
||||
|
||||
def simpleMatch(token, pattern):
|
||||
for p in pattern.split(' '):
|
||||
|
|
|
@ -2012,7 +2012,7 @@ class MisraChecker:
|
|||
errmsg = 'misra violation (use --rule-texts=<file> to get proper output)'
|
||||
else:
|
||||
return
|
||||
cppcheckdata.reportErrorCli(location, severity, errmsg, 'misra', errorId)
|
||||
cppcheckdata.reportError(location, severity, errmsg, 'misra', errorId)
|
||||
|
||||
if not severity in self.violations:
|
||||
self.violations[severity] = []
|
||||
|
|
|
@ -35,7 +35,7 @@ for arg in sys.argv[1:]:
|
|||
validate_regex(RE_FUNCTIONNAME)
|
||||
|
||||
def reportError(token, severity, msg, errorId):
|
||||
cppcheckdata.reportErrorCli(token, severity, msg, 'naming', errorId)
|
||||
cppcheckdata.reportError(token, severity, msg, 'naming', errorId)
|
||||
|
||||
for arg in sys.argv[1:]:
|
||||
if not arg.endswith('.dump'):
|
||||
|
|
|
@ -8,7 +8,7 @@ import cppcheckdata
|
|||
import sys
|
||||
|
||||
def reportError(token, severity, msg, id):
|
||||
cppcheckdata.reportErrorCli(token, severity, msg, 'threadsafety', id)
|
||||
cppcheckdata.reportError(token, severity, msg, 'threadsafety', id)
|
||||
|
||||
|
||||
def checkstatic(data):
|
||||
|
|
Loading…
Reference in New Issue