Add ability to detect SPDXIDs by reserved keyname#27
Conversation
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
…unctions Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
…unctions Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
…unctions Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
…unctions Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
| 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.
you removed the skipping of large files here
| NormalizedText: normalizedData.NormalizedText, | ||
| Hash: normalizedData.Hash, | ||
| } | ||
| // ret := IdentifierResults{ |
There was a problem hiding this comment.
don't leave in the commented out code
markstur
left a comment
There was a problem hiding this comment.
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 <mrutkows@us.ibm.com>
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 <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
Signed-off-by: Matt Rutkowski <mrutkows@us.ibm.com>
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.