Skip to content

Commit d1456f0

Browse files
Brough back hash creation for each pitfall
1 parent ed95768 commit d1456f0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/metacheck/utils/json_ld_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ def create_pitfall_jsonld(somef_data: Dict, pitfall_results: List[Dict], file_na
484484
"""
485485
Create a JSON-LD structure for detected pitfalls following the sample format.
486486
"""
487+
import hashlib
487488
software_info = extract_software_info_from_somef(somef_data)
488489
description_info = extract_description_info(somef_data)
489490

@@ -533,6 +534,9 @@ def create_pitfall_jsonld(somef_data: Dict, pitfall_results: List[Dict], file_na
533534
"evidence": evidence_val,
534535
"suggestion": suggestion_val
535536
}
537+
538+
check_hash = hashlib.sha256(json.dumps(check_result, sort_keys=True).encode("utf-8")).hexdigest()
539+
check_result["checkId"] = check_hash
536540

537541
jsonld_output["checks"].append(check_result)
538542

0 commit comments

Comments
 (0)