Skip to content

Commit

Permalink
addons/cppcheckdata.py: Make reportError() return the line written.
Browse files Browse the repository at this point in the history
This is useful for self-verification, as is done by namingng.py. The return
value of reportError() is otherwise not used.
  • Loading branch information
mvds00 committed Dec 23, 2023
1 parent 5a222b8 commit 63f93a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addons/cppcheckdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1629,16 +1629,19 @@ def reportError(location, severity, message, addon, errorId, extra=''):
'addon': addon,
'errorId': errorId,
'extra': extra}
sys.stdout.write(json.dumps(msg) + '\n')
line = json.dumps(msg) + '\n'
sys.stdout.write(line)
else:
if is_suppressed(location, message, '%s-%s' % (addon, errorId)):
return
loc = '[%s:%i]' % (location.file, location.linenr)
if len(extra) > 0:
message += ' (' + extra + ')'
sys.stderr.write('%s (%s) %s [%s-%s]\n' % (loc, severity, message, addon, errorId))
line = '%s (%s) %s [%s-%s]\n' % (loc, severity, message, addon, errorId)
sys.stderr.write(line)
global EXIT_CODE
EXIT_CODE = 1
return line

def reportSummary(dumpfile, summary_type, summary_data):
# dumpfile ends with ".dump"
Expand Down

0 comments on commit 63f93a1

Please sign in to comment.