mirror of
https://github.com/anchore/syft.git
synced 2026-11-05 00:46:38 +01:00
feat: report unknowns in sbom (#2998)
Signed-off-by: Keith Zantow <kzantow@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
co-authored by
Alex Goodman
parent
4d7ed9f749
commit
ccbee94b87
@@ -2,6 +2,7 @@ package lua
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/anchore/syft/internal/log"
|
||||
@@ -30,7 +31,7 @@ func parseRockspec(_ context.Context, _ file.Resolver, _ *generic.Environment, r
|
||||
doc, err := parseRockspecData(reader)
|
||||
if err != nil {
|
||||
log.WithFields("error", err).Trace("unable to parse Rockspec app")
|
||||
return nil, nil, nil
|
||||
return nil, nil, fmt.Errorf("unable to parse Rockspec app: %w", err)
|
||||
}
|
||||
|
||||
var name, version, license, homepage, description, url string
|
||||
|
||||
@@ -106,3 +106,10 @@ func TestParseRockspec(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_corruptRockspec(t *testing.T) {
|
||||
pkgtest.NewCatalogTester().
|
||||
FromFile(t, "test-fixtures/corrupt/bad-1.23.0-0.rockspec").
|
||||
WithError().
|
||||
TestParser(t, parseRockspec)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package = {"kon
|
||||
|
||||
3.7.0-0"
|
||||
rockspec_fo}
|
||||
}
|
||||
Reference in New Issue
Block a user