From 7ff58dacff524ec8ddedb55ae6b2bb66550b4ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 4 Jul 2023 13:23:19 +0200 Subject: [PATCH] daca: filter checker results when there are syntaxError/unknownMacro/etc (#5214) --- tools/donate_cpu_lib.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/donate_cpu_lib.py b/tools/donate_cpu_lib.py index cb6fe0790..daddaddf3 100644 --- a/tools/donate_cpu_lib.py +++ b/tools/donate_cpu_lib.py @@ -606,6 +606,25 @@ def diff_results(ver1, results1, ver2, results2): ret += ver2 + ' ' + r2[i2] + '\n' i2 += 1 + # if there are syntaxError/unknownMacro/etc then analysis stops. + # diffing normal checker warnings will not make much sense + bailout_ids = ('[syntaxError]', '[unknownMacro]') + has_bailout_id = False + for id in bailout_ids: + if (id in results1) or (id in results1): + has_bailout_id = True + if has_bailout_id: + def check_bailout(line): + for id in bailout_ids: + if line.endswith(id): + return True + return False + out = '' + for line in ret.split('\n'): + if check_bailout(line): + out += line + '\n' + ret = out + return ret