Skip to content

Commit 193aeb8

Browse files
committed
fix extra-words detection
Signed-off-by: Alok Kumar <alokkumarjipura9973@gmail.com>
1 parent 9ed912f commit 193aeb8

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

src/licensedcode/detection.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,26 +1055,10 @@ def is_correct_detection_non_unknown(license_matches):
10551055
are correct/perfect license detections and also there aren't any unknowns.
10561056
"""
10571057
return (
1058-
is_correct_detection_2(license_matches)
1058+
is_correct_detection(license_matches)
10591059
and not has_unknown_matches(license_matches)
1060-
)
1061-
1062-
def is_correct_detection_2(license_matches):
1063-
"""
1064-
Return True if all the matches in ``license_matches`` List of LicenseMatch
1065-
are perfect license detections, and the matcher is always either `1-hash`
1066-
or `1-spdx-id`.
1067-
"""
1068-
matchers = (license_match.matcher for license_match in license_matches)
1069-
is_match_coverage_perfect = [
1070-
license_match.coverage() == 100
1071-
for license_match in license_matches
1072-
]
1073-
1074-
return (
1075-
all(matcher in ("1-hash", "1-spdx-id") for matcher in matchers)
1076-
and all(is_match_coverage_perfect)
1077-
)
1060+
and not has_extra_words(license_matches)
1061+
)
10781062

10791063

10801064
def is_correct_detection(license_matches):

0 commit comments

Comments
 (0)