3030SPDX_REPLACE_WORDS = ["(" , ")" ]
3131KEY_AND = r"(?<=\s)and(?=\s)"
3232KEY_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
4134
4235
4336def is_gpl_family_license (licenses : list ) -> bool :
@@ -49,10 +42,9 @@ def is_gpl_family_license(licenses: list) -> bool:
4942 continue
5043
5144 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
5648
5749 return False
5850
0 commit comments