From e1e1a44217e3e31eb6c40be82605e0b456a3ac28 Mon Sep 17 00:00:00 2001 From: Kevin Ji Date: Sat, 25 Jun 2022 15:44:23 -0400 Subject: [PATCH] Enable using installed licenses in scans #2994 This allows users to use licenses that they install via wheels in license scans. It also adds a sample package containing an external license that can be used to manually verify expected behavior. Signed-off-by: Kevin Ji --- src/licensedcode/cache.py | 9 + src/licensedcode/models.py | 21 ++ .../licenses_to_install1/.gitignore | 2 + .../licenses_to_install1/MANIFEST.in | 7 + .../licenses_to_install1/gpl-1.0.LICENSE | 254 ++++++++++++++++++ .../licenses_to_install1/setup.cfg | 6 + .../licenses_to_install1/setup.py | 46 ++++ .../src/licenses_to_install1/__init__.py | 37 +++ .../licenses/exampleInstalled1.LICENSE | 1 + .../licenses/exampleInstalled1.yml | 5 + .../installed_licenses/scan.expected.json | 81 ++++++ .../installed_licenses/scan/license.txt | 1 + 12 files changed, 470 insertions(+) create mode 100644 tests/licensedcode/data/example_external_licenses/licenses_to_install1/.gitignore create mode 100644 tests/licensedcode/data/example_external_licenses/licenses_to_install1/MANIFEST.in create mode 100644 tests/licensedcode/data/example_external_licenses/licenses_to_install1/gpl-1.0.LICENSE create mode 100644 tests/licensedcode/data/example_external_licenses/licenses_to_install1/setup.cfg create mode 100644 tests/licensedcode/data/example_external_licenses/licenses_to_install1/setup.py create mode 100644 tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/__init__.py create mode 100644 tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/licenses/exampleInstalled1.LICENSE create mode 100644 tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/licenses/exampleInstalled1.yml create mode 100644 tests/licensedcode/data/plugin_license/installed_licenses/scan.expected.json create mode 100644 tests/licensedcode/data/plugin_license/installed_licenses/scan/license.txt diff --git a/src/licensedcode/cache.py b/src/licensedcode/cache.py index 5829fa792ac..5ff21332c23 100644 --- a/src/licensedcode/cache.py +++ b/src/licensedcode/cache.py @@ -362,7 +362,16 @@ def populate_cache(force=False, index_all_languages=False, additional_directorie """ Load or build and cache a LicenseCache. Return None. """ + from licensedcode.models import get_paths_to_installed_licenses_and_rules global _LICENSE_CACHE + + # include installed licenses + if not additional_directories: + additional_directories = get_paths_to_installed_licenses_and_rules() + else: + # additional_directories is originally a tuple + additional_directories = list(additional_directories) + get_paths_to_installed_licenses_and_rules() + if need_cache_rebuild(additional_directories): force = True if force or not _LICENSE_CACHE: diff --git a/src/licensedcode/models.py b/src/licensedcode/models.py index f2a0635d98b..476c9fe15c9 100644 --- a/src/licensedcode/models.py +++ b/src/licensedcode/models.py @@ -74,6 +74,8 @@ CATEGORIES = FOSS_CATEGORIES | OTHER_CATEGORIES +# prefix for name of all externally installed license plugins +EXTERNAL_LICENSE_PLUGIN_PREFIX = 'licenses' @attr.s(slots=True) class License: @@ -794,6 +796,25 @@ def get_rule_dirs( return [f"{str(Path(path).absolute())}/rules" for path in additional_dirs] +def get_paths_to_installed_licenses_and_rules(): + """ + Returns a list of paths to externally packaged licenses or rules that the user has + installed. Gets a list of all of these licenses (installed as plugins) and + then gets the plugins containing licenses by checking that their names start + with a common prefix. + """ + from importlib_metadata import entry_points + from plugincode.location_provider import get_location + installed_plugins = entry_points(group='scancode_location_provider') + paths = [] + for plugin in installed_plugins: + if plugin.name.startswith(EXTERNAL_LICENSE_PLUGIN_PREFIX): + # get path to directory of licenses and/or rules + location_key = plugin.name + paths.append(get_location(location_key)) + return paths + + def load_licenses_from_multiple_dirs( license_directories, with_deprecated=False, diff --git a/tests/licensedcode/data/example_external_licenses/licenses_to_install1/.gitignore b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/.gitignore new file mode 100644 index 00000000000..95832e8eb97 --- /dev/null +++ b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/.gitignore @@ -0,0 +1,2 @@ +/build/ +/dist/ \ No newline at end of file diff --git a/tests/licensedcode/data/example_external_licenses/licenses_to_install1/MANIFEST.in b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/MANIFEST.in new file mode 100644 index 00000000000..b566ab1f35d --- /dev/null +++ b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/MANIFEST.in @@ -0,0 +1,7 @@ +graft src +graft thirdparty + +include setup.* +include *.rst +include *LICENSE* +include *NOTICE* \ No newline at end of file diff --git a/tests/licensedcode/data/example_external_licenses/licenses_to_install1/gpl-1.0.LICENSE b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/gpl-1.0.LICENSE new file mode 100644 index 00000000000..c510b2875fe --- /dev/null +++ b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/gpl-1.0.LICENSE @@ -0,0 +1,254 @@ +GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 + + Copyright (C) 1989 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The license agreements of most software companies try to keep users +at the mercy of those companies. By contrast, our General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. The +General Public License applies to the Free Software Foundation's +software and to any other program whose authors commit to using it. +You can use it for your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Specifically, the General Public License is designed to make +sure that you have the freedom to give away or sell copies of free +software, that you receive source code or can get it if you want it, +that you can change the software or use pieces of it in new free +programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of a such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must tell them their rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + The precise terms and conditions for copying, distribution and +modification follow. + + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any program or other work which +contains a notice placed by the copyright holder saying it may be +distributed under the terms of this General Public License. The +"Program", below, refers to any such program or work, and a "work based +on the Program" means either the Program or any work containing the +Program or a portion of it, either verbatim or with modifications. Each +licensee is addressed as "you". + + 1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +General Public License and to the absence of any warranty; and give any +other recipients of the Program a copy of this General Public License +along with the Program. You may charge a fee for the physical act of +transferring a copy. + + 2. You may modify your copy or copies of the Program or any portion of +it, and copy and distribute such modifications under the terms of Paragraph +1 above, provided that you also do the following: + + a) cause the modified files to carry prominent notices stating that + you changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that + in whole or in part contains the Program or any part thereof, either + with or without modifications, to be licensed at no charge to all + third parties under the terms of this General Public License (except + that you may choose to grant warranty protection to some or all + third parties, at your option). + + c) If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the simplest and most usual way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this General + Public License. + + d) You may charge a fee for the physical act of transferring a + copy, and you may at your option offer warranty protection in + exchange for a fee. + +Mere aggregation of another independent work with the Program (or its +derivative) on a volume of a storage or distribution medium does not bring +the other work under the scope of these terms. + + + 3. You may copy and distribute the Program (or a portion or derivative of +it, under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Paragraphs 1 and 2 above; or, + + b) accompany it with a written offer, valid for at least three + years, to give any third party free (except for a nominal charge + for the cost of distribution) a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of + Paragraphs 1 and 2 above; or, + + c) accompany it with the information you received as to where the + corresponding source code may be obtained. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form alone.) + +Source code for a work means the preferred form of the work for making +modifications to it. For an executable file, complete source code means +all the source code for all modules it contains; but, as a special +exception, it need not include source code for modules which are standard +libraries that accompany the operating system on which the executable +file runs, or for standard header files or definitions files that +accompany that operating system. + + 4. You may not copy, modify, sublicense, distribute or transfer the +Program except as expressly provided under this General Public License. +Any attempt otherwise to copy, modify, sublicense, distribute or transfer +the Program is void, and will automatically terminate your rights to use +the Program under this License. However, parties who have received +copies, or rights to use copies, from you under this General Public +License will not have their licenses terminated so long as such parties +remain in full compliance. + + 5. By copying, distributing or modifying the Program (or any work based +on the Program) you indicate your acceptance of this license to do so, +and all its terms and conditions. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these +terms and conditions. You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. + + + 7. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of the license which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +the license, you may choose any version ever published by the Free Software +Foundation. + + 8. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to humanity, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19xx name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (a program to direct compilers to make passes + at assemblers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +That's all there is to it! \ No newline at end of file diff --git a/tests/licensedcode/data/example_external_licenses/licenses_to_install1/setup.cfg b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/setup.cfg new file mode 100644 index 00000000000..b463cb6c31e --- /dev/null +++ b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/setup.cfg @@ -0,0 +1,6 @@ +[metadata] +license_files = + gpl-1.0.LICENSE + +[aliases] +release = clean --all bdist_wheel --plat-name manylinux1_x86_64 --python-tag py3 \ No newline at end of file diff --git a/tests/licensedcode/data/example_external_licenses/licenses_to_install1/setup.py b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/setup.py new file mode 100644 index 00000000000..fe37237af0d --- /dev/null +++ b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/setup.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- + +from glob import glob +from os.path import basename +from os.path import join +from os.path import splitext + +from setuptools import find_packages +from setuptools import setup + + +desc = '''A ScanCode path provider plugin to provide a set of example external licenses that can be installed.''' + +setup( + name='licenses_to_install1', + version='1.0', + license=( + 'apache-2.0 AND bsd-simplified-darwin AND (bsd-simplified AND public-domain AND ' + 'bsd-new AND isc AND (bsd-new OR gpl-1.0-plus) AND bsd-original)' + ), + description=desc, + long_description=desc, + author='nexB', + author_email='info@aboutcode.org', + url='https://github.com/nexB/scancode-plugins', + packages=find_packages('src'), + package_dir={'': 'src'}, + include_package_data=True, + py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')], + zip_safe=False, + classifiers=[ + # complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'Topic :: Utilities', + ], + keywords=[ + 'open source', 'scancode_licenses', + ], + entry_points={ + 'scancode_location_provider': [ + 'licenses_to_install1 = licenses_to_install1:LicensesToInstall1Paths', + ], + }, +) \ No newline at end of file diff --git a/tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/__init__.py b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/__init__.py new file mode 100644 index 00000000000..1fdba1cfb9e --- /dev/null +++ b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/__init__.py @@ -0,0 +1,37 @@ +# +# Copyright (c) nexB Inc. and others. +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this list +# of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright notice, this +# list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +from os.path import abspath +from os.path import dirname + +from plugincode.location_provider import LocationProviderPlugin + + +class LicensesToInstall1Paths(LocationProviderPlugin): + def get_locations(self): + curr_dir = dirname(abspath(__file__)) + locations = { + 'licenses_to_install1': curr_dir, + } + return locations diff --git a/tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/licenses/exampleInstalled1.LICENSE b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/licenses/exampleInstalled1.LICENSE new file mode 100644 index 00000000000..f0455cbed1b --- /dev/null +++ b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/licenses/exampleInstalled1.LICENSE @@ -0,0 +1 @@ +This is a test license that must be installed into ScanCode Toolkit. diff --git a/tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/licenses/exampleInstalled1.yml b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/licenses/exampleInstalled1.yml new file mode 100644 index 00000000000..e72e78fdd4b --- /dev/null +++ b/tests/licensedcode/data/example_external_licenses/licenses_to_install1/src/licenses_to_install1/licenses/exampleInstalled1.yml @@ -0,0 +1,5 @@ +key: exampleInstalled1 +short_name: Example Installed License 1 +name: Example Installed License 1 +category: Permissive +owner: NexB \ No newline at end of file diff --git a/tests/licensedcode/data/plugin_license/installed_licenses/scan.expected.json b/tests/licensedcode/data/plugin_license/installed_licenses/scan.expected.json new file mode 100644 index 00000000000..6226a744fa7 --- /dev/null +++ b/tests/licensedcode/data/plugin_license/installed_licenses/scan.expected.json @@ -0,0 +1,81 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "options": { + "input": "", + "-dir": "", + "--json": "", + "--license": true, + "--strip-root": true + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "output_format_version": "2.0.0", + "message": null, + "errors": [], + "warnings": [], + "extra_data": { + "system_environment": { + "operating_system": "linux", + "cpu_architecture": "64", + "platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic", + "platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022", + "python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]" + }, + "spdx_license_list_version": "3.16", + "files_count": 2 + } + } + ], + "files": [ + { + "path": "license.txt", + "type": "file", + "licenses": [ + { + "key": "example1", + "score": 100.0, + "name": "Example External License 1", + "short_name": "Example External License 1", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "NexB", + "homepage_url": "", + "text_url": "", + "reference_url": "https://scancode-licensedb.aboutcode.org/example1", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/example1.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/example1.yml", + "spdx_license_key": "", + "spdx_url": "", + "start_line": 1, + "end_line": 1, + "matched_rule": { + "identifier": "example1.LICENSE", + "license_expression": "example1", + "licenses": [ + "example1" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 9, + "matched_length": 9, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } + ], + "license_expressions": [ + "example1" + ], + "percentage_of_license_text": 10.98, + "scan_errors": [] + } + ] +} diff --git a/tests/licensedcode/data/plugin_license/installed_licenses/scan/license.txt b/tests/licensedcode/data/plugin_license/installed_licenses/scan/license.txt new file mode 100644 index 00000000000..f0455cbed1b --- /dev/null +++ b/tests/licensedcode/data/plugin_license/installed_licenses/scan/license.txt @@ -0,0 +1 @@ +This is a test license that must be installed into ScanCode Toolkit.