-
-
Notifications
You must be signed in to change notification settings - Fork 595
Display extra-words
in detection_log
if present
#4402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Display extra-words
in detection_log
if present
#4402
Conversation
ff9eaec
to
2a4c4c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alok1304 thanks! See comments for changes.
Please always run a subset of the tests which could be effected locally and inspect failures before raising a PR, and make sure you also regenerate test expectations for these failures, and verify that they are intended. See https://scancode-toolkit.readthedocs.io/en/stable/contribute/contrib_dev.html#running-tests
Please also add a test from #4400 just focused on extra words, without tests it's much more work for reviewers to verify this is working correctly.
4042c2b
to
a4415e7
Compare
1e24b13
to
49bac47
Compare
still, we are not getting extra-words in
I am trying to find examples files where extra-words are present. |
c33c3c0
to
bad458f
Compare
@AyanSinhaMahapatra I added test when we get
|
bad458f
to
7516775
Compare
These failing test cases are passing on my system see
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alok1304, looking good mostly, ready to merge with a couple changes, see comments for more details.
Don't worry about the extra test failures, there are there because of #4369, in the tests where we perform a force upgrade of all our dependencies and run the tests there. See https://github.com/aboutcode-org/scancode-toolkit/blob/develop/azure-pipelines.yml#L224
src/licensedcode/detection.py
Outdated
@@ -1726,7 +1734,7 @@ def analyze_detection(license_matches, package_license=False): | |||
): | |||
return DetectionCategory.LICENSE_CLUES.value | |||
|
|||
# Case where all matches have `matcher` as `1-hash` or `4-spdx-id` | |||
# Case where all matches have `matcher` as `1-hash` or `4-spdx-id` or 2-aho |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct, could you revert is_correct_detection
back to:
all(matcher in ("1-hash", "1-spdx-id") for matcher in matchers)
The 2-aho
cases are meant to be caught below here, only if all other cases in between are not present:
# Cases where Match Coverage is a perfect 100 for all matches
else:
return DetectionCategory.PERFECT_DETECTION.value
The only bug we needed to fix was in get_detected_license_expression
, where we were missing catching the analysis == DetectionCategory.EXTRA_WORDS.value
and thus the detection log not being populated..
5204567
to
197b261
Compare
These failing test cases happening when i change this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, please see comment below.
b15bfee
to
8f29232
Compare
@AyanSinhaMahapatra I did all modifications or changes that you said, in case of Also, I squash all my commits into a single commit. |
@alok1304 could you add the |
b253cd9
to
0532da8
Compare
Reference: aboutcode-org#4400 Signed-off-by: Alok Kumar <alokkumarjipura9973@gmail.com>
Signed-off-by: Alok Kumar <alokkumarjipura9973@gmail.com>
Signed-off-by: Alok Kumar <alokkumarjipura9973@gmail.com>
Signed-off-by: Alok Kumar <alokkumarjipura9973@gmail.com>
d8acde4
to
0b2d3a3
Compare
Hii @AyanSinhaMahapatra I do this things, |
extra_words
in secondary types of Detections.2-aho
from matcher because previously, due to this, we getperfect-detection
because of this https://github.com/aboutcode-org/scancode-toolkit/blob/develop/src/licensedcode/detection.py#L1729 , here2-aho
matcher included in this.update: when I do this many test cases are failing.
these work fine when our matcher is
3-seq
.Fixes #4400
Tasks
Run tests locally to check for errors.
Signed-off-by: Alok Kumar alokkumarjipura9973@gmail.com