diff --git a/addons/cert.py b/addons/cert.py index f0dd6ab99..8909cf04f 100755 --- a/addons/cert.py +++ b/addons/cert.py @@ -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(' '): diff --git a/addons/cppcheckdata.py b/addons/cppcheckdata.py index 095e38776..583db2708 100755 --- a/addons/cppcheckdata.py +++ b/addons/cppcheckdata.py @@ -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)) diff --git a/addons/findcasts.py b/addons/findcasts.py index b595cbb32..e44c94482 100755 --- a/addons/findcasts.py +++ b/addons/findcasts.py @@ -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') diff --git a/addons/misc.py b/addons/misc.py index 6de028d4a..6e2c59f4b 100644 --- a/addons/misc.py +++ b/addons/misc.py @@ -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(' '): diff --git a/addons/misra.py b/addons/misra.py index 40f73e01e..3b8be22fa 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -2012,7 +2012,7 @@ class MisraChecker: errmsg = 'misra violation (use --rule-texts= 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] = [] diff --git a/addons/naming.py b/addons/naming.py index 90d4f0a8a..ca59f57b9 100755 --- a/addons/naming.py +++ b/addons/naming.py @@ -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'): diff --git a/addons/threadsafety.py b/addons/threadsafety.py index ccf6503a4..bbcd4bc00 100755 --- a/addons/threadsafety.py +++ b/addons/threadsafety.py @@ -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):