-
Notifications
You must be signed in to change notification settings - Fork 588
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
Omit empty packages #312
Omit empty packages #312
Conversation
Signed-off-by: Dan Luhring <[email protected]>
@@ -172,6 +173,12 @@ 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" + |
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.
which fields? (I know, but a user will probably not)
} | ||
|
||
if len(actual) != 0 { | ||
t.Errorf("no packages should've been returned") |
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.
t.Errorf("no packages should've been returned") | |
t.Errorf("no packages should've been returned, but got %d", len(actual)) |
@@ -1,2 +1,5 @@ | |||
FROM alpine:latest | |||
RUN apk add tzdata vim alpine-sdk | |||
FROM alpine@sha256:d9a7354e3845ea8466bb00b22224d9116b183e594527fb5b6c3d30bc01a20378 |
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.
yassss
Signed-off-by: Dan Luhring <[email protected]>
e5bfbaa
to
9ec3ad5
Compare
Signed-off-by: Dan Luhring <[email protected]>
Signed-off-by: Dan Luhring <[email protected]>
Omit empty packages
Closes #311
This PR changes the parsing of
package.json
such that files that don't include the minimally required fields (currentlyname
andversion
) will not be surfaced as packages. ADEBUG
level message is logged in this case.