sarif = {'version': '2.1.0', 'runs': [{'tool': {'driver': {'name': 'DEMO scanner'}}, 'results': [{'ruleId': item['ruleId'], 'message': {'text': item['message']}, 'locations': [{'physicalLocation': {'artifactLocation': {'uri': item['path']}, 'region': {'startLine': item['line']}}}]} for item in data['findings']]}]}
write_json(folder / 'scan.sarif', sarif)
originals = {(row['ruleId'], row['path'], row['line']) for row in data['findings']}
check('摘要保留每个原始告警定位', {(row['ruleId'], row['path'], row['line']) for row in output['findings']} == originals)
save_csv(folder / 'findings.csv', output['findings'])
