|
12 | 12 | help="A list of python library name you want to check the license of.")
|
13 | 13 | parser.add_argument('--accepted_licenses', nargs='*',
|
14 | 14 | help="A list of license which are considered acceptable for your project.",
|
15 |
| - default=["Apache Software License", "Apache 2.0", "BSD", "ZLIB", "MIT", "Unlicense", "CC0", "CC-BY","PSF", "MPL", "Mozilla Public License 2.0", "Historical Permission Notice and Disclaimer", "HPND"]) |
| 15 | + default=["Apache Software License", "Apache 2.0", "BSD", "ZLIB", "MIT", "Unlicense", "CC0", "CC-BY", "PSF", "MPL", "Mozilla Public License 2.0", "Historical Permission Notice and Disclaimer", "HPND", "LGPL"]) |
16 | 16 | parser.add_argument('--forbidden_licenses', nargs='*',
|
17 | 17 | help="A list of license which are considered problematic for your project.",
|
18 | 18 | default=["GNU", "GPL", "Commons Clause", "BY-N"])
|
@@ -64,9 +64,11 @@ def is_license_in_list(license, license_list):
|
64 | 64 | print(f"{library_name}: {library_license}")
|
65 | 65 | # First checks if its refused_licenses, then if its in accepted_licenses, else add in the maybe list
|
66 | 66 |
|
67 |
| - if is_license_in_list(library_license, args.forbidden_licenses): |
| 67 | + is_forbidden = is_license_in_list(library_license, args.forbidden_licenses) |
| 68 | + is_accepted = is_license_in_list(library_license, args.accepted_licenses) |
| 69 | + if is_forbidden and not is_accepted: |
68 | 70 | refused_libraries.append(library_name)
|
69 |
| - elif is_license_in_list(library_license, args.accepted_licenses): |
| 71 | + elif is_accepted and not is_forbidden: |
70 | 72 | accepted_libraries.append(library_name)
|
71 | 73 | else:
|
72 | 74 | maybe_libraries.append(library_name)
|
|
0 commit comments