Given `matches` list of LicenseMatch objects, populate the `from_file` attribute in them with `path` which is the path for the origin file for that license match.
(matches, path)
| 719 | |
| 720 | |
| 721 | def populate_matches_with_path(matches, path): |
| 722 | """ |
| 723 | Given `matches` list of LicenseMatch objects, populate the `from_file` |
| 724 | attribute in them with `path` which is the path for the origin file for |
| 725 | that license match. |
| 726 | """ |
| 727 | for match in matches: |
| 728 | # Here if we have the `from_file` attribute populated already, |
| 729 | # they are from other files, and if it's empty, they are from |
| 730 | # the original resource, so we populate the files with the resource |
| 731 | # path for the original resource of their origin |
| 732 | if not match["from_file"]: |
| 733 | match["from_file"] = path |
| 734 | |
| 735 | |
| 736 | def collect_license_detections(codebase, include_license_clues=True): |
no outgoing calls
no test coverage detected