fix tests and linting

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman 2021-11-17 14:41:47 -05:00
parent e809403e94
commit d52894ce86
No known key found for this signature in database
GPG Key ID: 5CB45AE22BAB7EA7
3 changed files with 4 additions and 13 deletions

View File

@ -155,16 +155,7 @@ func toFiles(s sbom.SBOM) []model.File {
digests = digestsForLocation digests = digestsForLocation
} }
// TODO: these could make it into the document // TODO: add file classifications (?) and content as a snippet
//var classifications []file.Classification
//if classificationsForLocation, exists := artifacts.FileClassifications[coordinates]; exists {
// classifications = classificationsForLocation
//}
//
//var contents string
//if contentsForLocation, exists := artifacts.FileContents[coordinates]; exists {
// contents = contentsForLocation
//}
var comment string var comment string
if coordinates.FileSystemID != "" { if coordinates.FileSystemID != "" {

View File

@ -113,9 +113,9 @@ func packageFileOwnershipRelationships(p pkg.Package, resolver source.FilePathRe
return nil, fmt.Errorf("unable to find path for path=%q: %w", path, err) return nil, fmt.Errorf("unable to find path for path=%q: %w", path, err)
} }
//if len(locations) == 0 { // if len(locations) == 0 {
// // TODO: this is notable, we should at least log it(?)... however, ideally there is something in the SBOM about this // // TODO: this is notable, we should at least log it(?)... however, ideally there is something in the SBOM about this
//} // }
for _, l := range locations { for _, l := range locations {
relationships = append(relationships, artifact.Relationship{ relationships = append(relationships, artifact.Relationship{

View File

@ -24,7 +24,7 @@ func TestPackageOwnershipRelationships(t *testing.T) {
t.Run(test.fixture, func(t *testing.T) { t.Run(test.fixture, func(t *testing.T) {
sbom, _ := catalogFixtureImage(t, test.fixture) sbom, _ := catalogFixtureImage(t, test.fixture)
p := syftjson.Format().Presenter(sbom) p := syftjson.Format().Presenter(sbom, nil)
if p == nil { if p == nil {
t.Fatal("unable to get presenter") t.Fatal("unable to get presenter")
} }