Cleanup in place the ``scan_results`` mapping for dates, headers and other variable data that break tests otherwise.
(scan_results, remove_file_date=False)
| 285 | |
| 286 | |
| 287 | def cleanup_scan(scan_results, remove_file_date=False): |
| 288 | """ |
| 289 | Cleanup in place the ``scan_results`` mapping for dates, headers and |
| 290 | other variable data that break tests otherwise. |
| 291 | """ |
| 292 | # clean new headers attributes |
| 293 | streamline_headers(scan_results.get('headers', [])) |
| 294 | # clean file_level attributes |
| 295 | for scanned_file in scan_results['files']: |
| 296 | streamline_scanned_file(scanned_file, remove_file_date) |
| 297 | |
| 298 | # TODO: remove sort, this should no longer be needed |
| 299 | scan_results['files'].sort(key=lambda x: x['path']) |
| 300 | return scan_results |
| 301 | |
| 302 | |
| 303 | def streamline_errors(errors): |
no test coverage detected