-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(license): add new flag for classifier confidence level #4073
Conversation
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.
Hello @thevibegod
Thanks for your work!
Resolve conflicts(pull of main branch should help), please.
I added some comments. Take a look, please.
Also i think we need to add more information about confidence level to docs. (default value, how value affects to number of licenses, etc...)
--license-confidence-level float specify classifier confidence level (default 0.9) | ||
--license-full eagerly look for licenses in source code headers and license files |
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.
if i remember correctly - k8s mode doesn't support find licenses.
Looks like we can remove this -
Line 818 in 914c6f0
LicenseFlagGroup: flag.NewLicenseFlagGroup(), |
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.
Made the above mentioned changes.
docs/docs/references/cli/trivy_vm.md
Outdated
--license-confidence-level float specify classifier confidence level (default 0.9) | ||
--license-full eagerly look for licenses in source code headers and license files |
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.
same
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.
Made the above mentioned changes.
@@ -50,13 +50,16 @@ type gomodAnalyzer struct { | |||
|
|||
// go.mod/go.sum in dependencies | |||
leafModParser godeptypes.Parser | |||
|
|||
opt analyzer.AnalyzerOptions |
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.
We use only 1 value. We don't need to move all options
opt analyzer.AnalyzerOptions | |
classifierConfidenceLevel float64 |
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.
Made the above mentioned changes.
pkg/fanal/analyzer/analyzer.go
Outdated
FileChecksum bool | ||
Offline bool | ||
FileChecksum bool | ||
ClassifierConfidenceLevel float64 |
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.
I am not sure about this changes.
For licensing
and dpkg
packages we can use Init
functions as for dpkg copyright files.
In this case we move this value to analyzers
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.
Made the above mentioned changes.
@DmitriyLewen Thanks for reviewing and providing the suggestions. Have made all the above mentioned changes and also updated the docs with examples. Please review them and let me know if there are any more changes to be done. |
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 for your work!
LGTM.
@thevibegod can you run |
@DmitriyLewen I have updated the docs. |
cool! thanks! |
Thanks! |
Description
--license-confidence-level
that accepts a float value(default 0.9)Classify
method ofclassifier.go
.Related issues
confidence level
in the license scanner #3378Checklist