MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / load_yaml_results

Function load_yaml_results

tests/formattedcode/test_output_yaml.py:125–135  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

123
124
125def 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)

Callers 1

check_yaml_scanFunction · 0.85

Calls 3

cleanup_scanFunction · 0.90
readMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected