Skip to content

Commit ed4fbf9

Browse files
committed
Simplify unknown license presence check
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent f2f36d6 commit ed4fbf9

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/licensedcode/detection.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,20 +338,10 @@ def identifier_with_expression(self):
338338
def is_unknown(self):
339339
"""
340340
Return True if there are unknown license keys in the license expression
341-
for this detection, return False otherwise.
341+
for this detection, return False otherwise. By design these are licenses with "unknown" in
342+
their key.
342343
"""
343-
unknown_license_keys = [
344-
"unknown-license-reference",
345-
"unknown-spdx",
346-
"unknown",
347-
"free-unknown"
348-
]
349-
350-
for license_key in unknown_license_keys:
351-
if license_key in self.license_expression:
352-
return True
353-
354-
return False
344+
return 'unknown' in self.license_expression
355345

356346
def get_start_end_line(self):
357347
"""

0 commit comments

Comments
 (0)