Skip to content

Commit d718793

Browse files
committed
htmlreport: sort error-data per line (in index.html page as well as in the defect list of the respective files.)
1 parent c5e9da2 commit d718793

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

htmlreport/cppcheck-htmlreport

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ if __name__ == '__main__':
348348
options.title,
349349
filename))
350350

351-
for error in errors:
351+
for error in sorted(errors, key=lambda k: k['line']):
352352
output_file.write("<a href='%s#line-%d'> %s %s</a>" % (data['htmlfile'], error['line'], error['id'], error['line']))
353353

354354
output_file.write(HTML_HEAD_END)
@@ -382,7 +382,7 @@ if __name__ == '__main__':
382382
output_file.write(
383383
"\n <tr><td colspan='4'><a href='%s'>%s</a></td></tr>" %
384384
(data['htmlfile'], filename))
385-
for error in data['errors']:
385+
for error in sorted(data['errors'], key=lambda k: k['line']):
386386
error_class = ''
387387
try:
388388
if error['inconclusive'] == 'true':

0 commit comments

Comments
 (0)