From fe055bf34307fab6c0144d080a01072d701c38ef Mon Sep 17 00:00:00 2001 From: Jeroen Oortwijn Date: Tue, 22 Sep 2015 00:35:15 +0200 Subject: [PATCH] change html output to confirm to XHTML Strict Several errors in the html output caused WebPositive to not render the file completely. Signed-off-by: Adrien Destugues Fixes #12387. --- src/tools/checkstyle/checkstyle.py | 4 ++-- src/tools/checkstyle/utils.py | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/tools/checkstyle/checkstyle.py b/src/tools/checkstyle/checkstyle.py index fb581ef614..7b86341cab 100755 --- a/src/tools/checkstyle/checkstyle.py +++ b/src/tools/checkstyle/checkstyle.py @@ -58,9 +58,9 @@ cppRules["Operator at line end"] = re.compile('([*=/+\-\|\&\?]|\&&|\|\|)(?=\n)') cppRules["Missing space"] = re.compile('\){') cppRules["Mixed tabs/spaces"] = re.compile('( \t]|\t )+') cppRules["Malformed else"] = re.compile('}[ \t]*\n[ \t]*else') -cppRules["Lines between functions > 2"] \ +cppRules["Lines between functions > 2"] \ = re.compile('(?<=\n})([ \t]*\n){3,}(?=\n)') -cppRules["Lines between functions < 2"] \ +cppRules["Lines between functions < 2"] \ = re.compile('(?<=\n})([ \t]*\n){0,2}(?=.)') cppRules["Windows Line Ending"] = re.compile('\r') cppRules["Bad pointer/reference style"] \ diff --git a/src/tools/checkstyle/utils.py b/src/tools/checkstyle/utils.py index 8b20575811..8b587d4cce 100644 --- a/src/tools/checkstyle/utils.py +++ b/src/tools/checkstyle/utils.py @@ -27,9 +27,9 @@ def openHtml(fileList, outputFileName): -

File list:
""") +

File list:
""") for fileName in fileList: - file.write(fileName + "
") + file.write(fileName + "
") file.write("

") file.close() @@ -37,7 +37,6 @@ def openHtml(fileList, outputFileName): def closeHtml(outputFileName): file = open(outputFileName, 'a') file.write(""" - """) @@ -67,14 +66,14 @@ def renderHtml(text, highlights, sourceFileName, outputFileName): file.write('
')
     count = 1
     for line in temp.split('\n'):
-        file.write(str(count).rjust(4)+"
") + file.write(str(count).rjust(4)+"
") count += 1 file.write('
')
 
     for line in temp.split('\n'):
         file.write(' ' + line.replace('\r', ' ') \
-             + '
') + + '
') file.write("
")