-
-
Notifications
You must be signed in to change notification settings - Fork 9
Add ability to detect SPDXIDs by reserved keyname #27
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: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
…unctions Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
…unctions Signed-off-by: Matt Rutkowski <[email protected]>
…unctions Signed-off-by: Matt Rutkowski <[email protected]>
…unctions Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
if fi.Size() > 1000000 { | ||
Logger.Errorf("file too large (%v > 1000000)", fi.Size()) // log error, but return nil | ||
return IdentifierResults{}, nil | ||
err = Logger.Errorf("file too large (%v > 1000000)", fi.Size()) // log error, but return nil |
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.
you removed the skipping of large files here
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.
good catch
identifier/identifier.go
Outdated
NormalizedText: normalizedData.NormalizedText, | ||
Hash: normalizedData.Hash, | ||
} | ||
// ret := IdentifierResults{ |
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.
don't leave in the commented out code
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.
more cleanup ;)
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.
some comments inline and I realize it's a draft.
It would be an easier review if there were not refactor/renames that are not necessary. Most of the diff I reviewed is not specifically relevant to this PR.
Signed-off-by: Matt Rutkowski <[email protected]>
pardon the rename of results to “identifierResults” (uniformly, hopefully) it was necessary for my sanity to assure we only allocated the return struct once and passed it across all pattern matching/find functions and wanted make sure I saw all the places with the type implied by the var name). |
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
Signed-off-by: Matt Rutkowski <[email protected]>
It is a more-and-more popular convention to use the reserved keyname for declaring SPDX license IDs i.e., "SPDX-License-Identifier:" typically placed at the top of source files. The scanner must be able to look for these key-values explicitly (within the first X lines) and use the keyword to distinguish such SPDX IDs like "MIT" from words that contain "mit" in some normalized part of their text.