mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
Clarify debug message for package.json omissions
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
This commit is contained in:
parent
9ec3ad58c8
commit
d5779a9822
@ -174,9 +174,8 @@ func parsePackageJSON(_ string, reader io.Reader) ([]pkg.Package, error) {
|
||||
return nil, fmt.Errorf("failed to parse package.json file: %w", err)
|
||||
}
|
||||
|
||||
if !p.hasMinimumRequiredValues() {
|
||||
log.Debug("encountered package.json file without the minimum number of field values required for" +
|
||||
" consideration as a package")
|
||||
if !p.hasNameAndVersionValues() {
|
||||
log.Debug("encountered package.json file without a name and/or version field, ignoring this file")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@ -204,6 +203,6 @@ func parsePackageJSON(_ string, reader io.Reader) ([]pkg.Package, error) {
|
||||
return packages, nil
|
||||
}
|
||||
|
||||
func (p PackageJSON) hasMinimumRequiredValues() bool {
|
||||
func (p PackageJSON) hasNameAndVersionValues() bool {
|
||||
return p.Name != "" && p.Version != ""
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user