daca: filter checker results when there are syntaxError/unknownMacro/etc (#5214)

This commit is contained in:
Daniel Marjamäki 2023-07-04 13:23:19 +02:00 committed by GitHub
parent 260a214ef1
commit 7ff58dacff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -606,6 +606,25 @@ def diff_results(ver1, results1, ver2, results2):
ret += ver2 + ' ' + r2[i2] + '\n' ret += ver2 + ' ' + r2[i2] + '\n'
i2 += 1 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 return ret