Skip to content

Commit d96e69e

Browse files
tehami02AyanSinhaMahapatra
authored andcommitted
updated main.py to handle matched_text_diagnostics seperately
Signed-off-by: Shaikh Mohd Tehami <officialtehami@gmail.com>
1 parent 00437e1 commit d96e69e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/licensedcode/match.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,9 +780,11 @@ def to_dict(
780780
Return a "result" scan data built from a LicenseMatch object.
781781
"""
782782
matched_text = None
783+
matched_text_diagnostics = None
784+
783785
if include_text:
784786
if license_text_diagnostics:
785-
matched_text = self.matched_text(whole_lines=False, highlight=True)
787+
matched_text_diagnostics = self.matched_text(whole_lines=False, highlight=True)
786788
else:
787789
if whole_lines:
788790
matched_text = self.matched_text(whole_lines=True, highlight=False)
@@ -806,6 +808,8 @@ def to_dict(
806808

807809
if include_text:
808810
result['matched_text'] = matched_text
811+
if license_text_diagnostics:
812+
result['matched_text_diagnostics'] = matched_text_diagnostics
809813
return result
810814

811815
def get_highlighted_text(self, trace=TRACE_HIGHLIGHTED_TEXT):

0 commit comments

Comments
 (0)