diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-07-04 22:54:55 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-07-07 14:12:26 +0200 |
commit | 372b109f4d90dca7bb53f93bc597ce1dd8ba5898 (patch) | |
tree | da1de25523070eca7c6a150a3a8891051b6509c1 /bin/gla11y | |
parent | 0a42d1e94ba9c35f2518f0fe08d3bf6eef8ff081 (diff) |
gla11y: improve warning printing
Also print the howto URL in messages about suppressed warnings
When showing suppression lines, also print the suppression file name.
Change-Id: I72da4149c505cec04bf715791f45a2b809d3ce63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97989
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'bin/gla11y')
-rwxr-xr-x | bin/gla11y | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/bin/gla11y b/bin/gla11y index f2dfbbdf81b2..80d3e54a371c 100755 --- a/bin/gla11y +++ b/bin/gla11y @@ -41,6 +41,8 @@ except ImportError: import xml.etree.ElementTree as ET lxml = False +howto_url = "https://wiki.documentfoundation.org/Development/Accessibility" + # Toplevel widgets widgets_toplevel = [ 'GtkWindow', @@ -1376,7 +1378,7 @@ def main(): continue prefix = line.rstrip() suppressions[prefix] = True - suppressions_to_line[prefix] = line_no + suppressions_to_line[prefix] = "%s:%u" % (suppr, line_no) supprfile.close() except IOError: pass @@ -1429,19 +1431,19 @@ def main(): if errors > 0 or errexists > 0: output_buffer += "%s new error%s" % (errors, 's' if errors != 1 else '') if errexists > 0: - output_buffer += " (%s suppressed)" % (errexists) + output_buffer += " (%s suppressed by %s, please fix %s)" % (errexists, suppr, 'them' if errexists > 1 else 'it') output_buffer += "\n" if warnings > 0 or warnexists > 0: output_buffer += "%s new warning%s" % (warnings, 's' if warnings != 1 else '') if warnexists > 0: - output_buffer += " (%s suppressed)" % (warnexists) + output_buffer += " (%s suppressed by %s, please fix %s)" % (warnexists, suppr, 'them' if warnexists > 1 else 'it') output_buffer += "\n" if fatals > 0 or fatalexists > 0: output_buffer += "%s new fatal%s" % (fatals, 's' if fatals != 1 else '') if fatalexists > 0: - output_buffer += " (%s suppressed)" % (fatalexists) + output_buffer += " (%s suppressed by %s, please fix %s)" % (fatalexists, suppr, 'them' if fatalexists > 1 else 'it') output_buffer += "\n" n = 0 @@ -1459,10 +1461,14 @@ def main(): gen_supprfile.close() if outfile is not None: outfile.close() - if fatals > 0 and gen_suppr is None: - output_buffer += "Explanations are available on https://wiki.documentfoundation.org/Development/Accessibility" - print(output_header.rstrip() + "\n" + output_buffer) - sys.exit(1) + + if gen_suppr is None: + if output_buffer != "": + output_buffer += "Explanations are available on " + howto_url + "\n" + + if fatals > 0: + print(output_header.rstrip() + "\n" + output_buffer) + sys.exit(1) if len(output_buffer) > 0: print(output_header.rstrip() + "\n" + output_buffer) |