fix: minor cataloger and docs nits (#2519)

Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
This commit is contained in:
Dan Luhring 2024-01-19 17:29:47 -05:00 committed by GitHub
parent 3eab5932e5
commit df582e8463
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 4 deletions

View File

@ -115,6 +115,6 @@ func DefaultPackageTaskFactories() PackageTaskFactories {
pkgcataloging.DeclaredTag, pkgcataloging.DirectoryTag, pkgcataloging.InstalledTag, pkgcataloging.ImageTag, "binary"), pkgcataloging.DeclaredTag, pkgcataloging.DirectoryTag, pkgcataloging.InstalledTag, pkgcataloging.ImageTag, "binary"),
newSimplePackageTaskFactory(githubactions.NewActionUsageCataloger, pkgcataloging.DeclaredTag, pkgcataloging.DirectoryTag, "github", "github-actions"), newSimplePackageTaskFactory(githubactions.NewActionUsageCataloger, pkgcataloging.DeclaredTag, pkgcataloging.DirectoryTag, "github", "github-actions"),
newSimplePackageTaskFactory(githubactions.NewWorkflowUsageCataloger, pkgcataloging.DeclaredTag, pkgcataloging.DirectoryTag, "github", "github-actions"), newSimplePackageTaskFactory(githubactions.NewWorkflowUsageCataloger, pkgcataloging.DeclaredTag, pkgcataloging.DirectoryTag, "github", "github-actions"),
newSimplePackageTaskFactory(sbomCataloger.NewCataloger, pkgcataloging.ImageTag, pkgcataloging.DeclaredTag, pkgcataloging.DirectoryTag, pkgcataloging.ImageTag, "sbom"), // note: not evidence of installed packages newSimplePackageTaskFactory(sbomCataloger.NewCataloger, pkgcataloging.ImageTag, pkgcataloging.DeclaredTag, pkgcataloging.DirectoryTag, "sbom"), // note: not evidence of installed packages
} }
} }

View File

@ -101,7 +101,7 @@ const nativeImageMissingSymbolsError = "one or more symbols are missing from the
const nativeImageInvalidIndexError = "parsing the executable file generated an invalid index" const nativeImageInvalidIndexError = "parsing the executable file generated an invalid index"
const nativeImageMissingExportedDataDirectoryError = "exported data directory is missing" const nativeImageMissingExportedDataDirectoryError = "exported data directory is missing"
// newNativeImageCataloger returns a new Native Image cataloger object. // NewNativeImageCataloger returns a new Native Image cataloger object.
func NewNativeImageCataloger() pkg.Cataloger { func NewNativeImageCataloger() pkg.Cataloger {
return &NativeImageCataloger{} return &NativeImageCataloger{}
} }

View File

@ -64,7 +64,7 @@ func processList(s string) []string {
return results return results
} }
// parseGemFileLockEntries parses the gemfile.lock file and returns the packages and relationships found. // parseGemSpecEntries parses the gemspec file and returns the packages and relationships found.
func parseGemSpecEntries(_ file.Resolver, _ *generic.Environment, reader file.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) { func parseGemSpecEntries(_ file.Resolver, _ *generic.Environment, reader file.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) {
var pkgs []pkg.Package var pkgs []pkg.Package
var fields = make(map[string]interface{}) var fields = make(map[string]interface{})
@ -113,7 +113,7 @@ func parseGemSpecEntries(_ file.Resolver, _ *generic.Environment, reader file.Lo
return pkgs, nil, nil return pkgs, nil, nil
} }
// renderUtf8 takes any string escaped string sub-sections from the ruby string and replaces those sections with the UTF8 runes. // renderUtf8 takes any string escaped string subsections from the ruby string and replaces those sections with the UTF8 runes.
func renderUtf8(s string) string { func renderUtf8(s string) string {
fullReplacement := unicodePattern.ReplaceAllStringFunc(s, func(unicodeSection string) string { fullReplacement := unicodePattern.ReplaceAllStringFunc(s, func(unicodeSection string) string {
var replacement string var replacement string

View File

@ -8,6 +8,7 @@ import (
"github.com/anchore/syft/syft/pkg/cataloger/generic" "github.com/anchore/syft/syft/pkg/cataloger/generic"
) )
// NewSwiftPackageManagerCataloger returns a new Swift package manager cataloger object.
func NewSwiftPackageManagerCataloger() pkg.Cataloger { func NewSwiftPackageManagerCataloger() pkg.Cataloger {
return generic.NewCataloger("swift-package-manager-cataloger"). return generic.NewCataloger("swift-package-manager-cataloger").
WithParserByGlobs(parsePackageResolved, "**/Package.resolved", "**/.package.resolved") WithParserByGlobs(parsePackageResolved, "**/Package.resolved", "**/.package.resolved")