30
30
SPDX_REPLACE_WORDS = ["(" , ")" ]
31
31
KEY_AND = r"(?<=\s)and(?=\s)"
32
32
KEY_OR = r"(?<=\s)or(?=\s)"
33
- GPL_LICENSE_PATTERNS = [
34
- r'gpl' , # gpl, gpl-2.0, gpl-3.0
35
- r'lgpl' , # lgpl, lgpl-2.1, lgpl-3.0
36
- r'agpl' , # agpl, agpl-3.0
37
- r'gnu.*general.*public.*license' , # GNU General Public License
38
- r'gnu.*lesser.*general.*public.*license' , # GNU Lesser General Public License
39
- r'gnu.*affero.*general.*public.*license' # GNU Affero General Public License
40
- ]
33
+ GPL_LICENSE_PATTERN = r'((a|l)?gpl|gfdl)' # GPL, LGPL, AGPL, GFDL
41
34
42
35
43
36
def is_gpl_family_license (licenses : list ) -> bool :
@@ -49,10 +42,9 @@ def is_gpl_family_license(licenses: list) -> bool:
49
42
continue
50
43
51
44
license_lower = license_name .lower ()
52
- for pattern in GPL_LICENSE_PATTERNS :
53
- if re .search (pattern , license_lower ):
54
- logger .debug (f"GPL family license detected: { license_name } " )
55
- return True
45
+ if re .search (GPL_LICENSE_PATTERN , license_lower ):
46
+ logger .debug (f"GPL family license detected: { license_name } " )
47
+ return True
56
48
57
49
return False
58
50
0 commit comments