Skip to content

Commit e4f81ba

Browse files
committed
htmlreport: Few style fixes
* Fix wrong indentation * Use single quotes for consistency * It is fine to substitute %s with empty str
1 parent ab75b04 commit e4f81ba

1 file changed

Lines changed: 9 additions & 16 deletions

File tree

htmlreport/cppcheck-htmlreport

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -590,27 +590,20 @@ if __name__ == '__main__':
590590
if error['severity'] == 'error':
591591
error_class = 'class="error"'
592592
if error['id'] == 'missingInclude':
593-
output_file.write(
594-
'\n <tr><td></td><td>%s</td><td></td><td>%s</td><td>%s</td></tr>' %
595-
(error['id'], error['severity'], error['msg']))
593+
output_file.write(
594+
'\n <tr><td></td><td>%s</td><td></td><td>%s</td><td>%s</td></tr>' %
595+
(error['id'], error['severity'], error['msg']))
596596
elif (error['id'] == 'unmatchedSuppression') and filename.endswith('*'):
597597
output_file.write(
598-
"\n <tr><td></td><td>%s</td><td></td><td>%s</td><td %s>%s</td></tr>" %
598+
'\n <tr><td></td><td>%s</td><td></td><td>%s</td><td %s>%s</td></tr>' %
599599
(error['id'], error['severity'], error_class,
600600
error['msg']))
601601
else:
602-
if cwe_url:
603-
output_file.write(
604-
"\n <tr><td><a href='%s#line-%d'>%d</a></td><td>%s</td><td>%s</td><td>%s</td><td %s>%s</td></tr>" %
605-
(data['htmlfile'], error['line'], error['line'],
606-
error['id'], cwe_url, error['severity'], error_class,
607-
error['msg']))
608-
else:
609-
output_file.write(
610-
"\n <tr><td><a href='%s#line-%d'>%d</a></td><td>%s</td><td></td><td>%s</td><td %s>%s</td></tr>" %
611-
(data['htmlfile'], error['line'], error['line'],
612-
error['id'], error['severity'], error_class,
613-
error['msg']))
602+
output_file.write(
603+
'\n <tr><td><a href="%s#line-%d">%d</a></td><td>%s</td><td>%s</td><td>%s</td><td %s>%s</td></tr>' %
604+
(data['htmlfile'], error['line'], error['line'],
605+
error['id'], cwe_url, error['severity'], error_class,
606+
error['msg']))
614607

615608
output_file.write('\n </table>')
616609
output_file.write(HTML_FOOTER % contentHandler.versionCppcheck)

0 commit comments

Comments
 (0)