From 92ad22ca77833d5c5c8841ece9368a6843e20c8d Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 24 Feb 2022 08:46:14 +0100 Subject: checkers: merge table cells if mypy & mypy --strict give same result --- check_checkers.py | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'check_checkers.py') diff --git a/check_checkers.py b/check_checkers.py index e8b1b2f..aee3f49 100755 --- a/check_checkers.py +++ b/check_checkers.py @@ -192,7 +192,11 @@ def run( out.write('') if checker.extra_flags: out.write(' with ') - out.write(', '.join(f'{html.escape(flag)}' for flag in checker.extra_flags)) + out.write( + ', '.join( + f'{html.escape(flag)}' for flag in checker.extra_flags + ) + ) out.write('
({})'.format(html.escape(checker.version()))) out.write('') @@ -216,10 +220,23 @@ def run( error_ok = '# error' in code or '# maybe error' in code no_error_ok = '# error' not in code - for checker in checkers: - errors = checker_results[checker.__class__.__name__] + results = [ + (checker.__class__.__name__, checker_results[checker.__class__.__name__]) + for checker in checkers + ] + + while results: + class_name, errors = results.pop(0) expected = (errors and error_ok) or (not errors and no_error_ok) - out.write(''.format('ok' if expected else 'unexpected')) + colspan = 1 + if errors and results and results[0][1] == errors: + results.pop(0) + colspan = 2 + out.write( + ''.format( + 'ok' if expected else 'unexpected', colspan + ) + ) if errors: out.write('