From d71879354008a62b3ceed746f8ecc8eacebb1d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Mon, 21 Jul 2014 21:33:55 +0200 Subject: [PATCH] htmlreport: sort error-data per line (in index.html page as well as in the defect list of the respective files.) --- htmlreport/cppcheck-htmlreport | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport index 872544035..832f90527 100755 --- a/htmlreport/cppcheck-htmlreport +++ b/htmlreport/cppcheck-htmlreport @@ -348,7 +348,7 @@ if __name__ == '__main__': options.title, filename)) - for error in errors: + for error in sorted(errors, key=lambda k: k['line']): output_file.write(" %s %s" % (data['htmlfile'], error['line'], error['id'], error['line'])) output_file.write(HTML_HEAD_END) @@ -382,7 +382,7 @@ if __name__ == '__main__': output_file.write( "\n %s" % (data['htmlfile'], filename)) - for error in data['errors']: + for error in sorted(data['errors'], key=lambda k: k['line']): error_class = '' try: if error['inconclusive'] == 'true':