Load the YAML scan results file at `location`. To help with test resilience against small changes some attributes are removed or streamlined such as the "tool_version" and scan "errors". Also date attributes from "files" and "headers" entries are removed.
(location, remove_file_date=True)
| 123 | |
| 124 | |
| 125 | def load_yaml_results(location, remove_file_date=True): |
| 126 | """ |
| 127 | Load the YAML scan results file at `location`. |
| 128 | To help with test resilience against small changes some attributes are |
| 129 | removed or streamlined such as the "tool_version" and scan "errors". |
| 130 | Also date attributes from "files" and "headers" entries are removed. |
| 131 | """ |
| 132 | with open(location, encoding='utf-8') as res: |
| 133 | scan_results = res.read() |
| 134 | scan_results = saneyaml.load(scan_results) |
| 135 | return cleanup_scan(scan_results, remove_file_date=remove_file_date) |
no test coverage detected