Skip to content

Commit a910281

Browse files
committed
return referenced_filenames for licenses matches
Signed-off-by: akugarg <akanksha.garg2k@gmail.com>
1 parent 0dd52df commit a910281

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/licensedcode/models.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,15 @@ def has_unknown(self):
877877
# TODO: consider using the license_expression_object and the is_unknown
878878
# license flag instead
879879
return self.license_expression and 'unknown' in self.license_expression
880+
881+
@property
882+
def reference_files(self):
883+
"""
884+
Return referenced_filenames for license matches
885+
"""
886+
ref_files=[]
887+
ref_files.extend(self.referenced_filenames)
888+
return ref_files
880889

881890
def validate(self, licensing=None):
882891
"""

src/scancode/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ def _licenses_data_from_match(
266266
matched_rule['identifier'] = match.rule.identifier
267267
matched_rule['license_expression'] = match.rule.license_expression
268268
matched_rule['licenses'] = match.rule.license_keys()
269+
matched_rule['referenced_filenames'] = match.rule.reference_files
269270
matched_rule['is_license_text'] = match.rule.is_license_text
270271
matched_rule['is_license_notice'] = match.rule.is_license_notice
271272
matched_rule['is_license_reference'] = match.rule.is_license_reference

0 commit comments

Comments
 (0)