feat: Add Lua cataloger (#2613)

Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
This commit is contained in:
Laurent Goderre
2024-05-24 16:56:34 -04:00
committed by GitHub
parent 77b3f66404
commit b51252dbdb
33 changed files with 4754 additions and 82 deletions
@@ -27,6 +27,7 @@ func Test_OriginatorSupplier(t *testing.T) {
pkg.HackageStackYamlLockEntry{},
pkg.HackageStackYamlEntry{},
pkg.LinuxKernel{},
pkg.LuaRocksPackage{},
pkg.MicrosoftKbPatch{},
pkg.NixStoreEntry{},
pkg.NpmPackageLockEntry{},
@@ -185,6 +186,14 @@ func Test_OriginatorSupplier(t *testing.T) {
originator: "Person: auth",
supplier: "Person: auth",
},
{
name: "from Lua Rockspecs",
input: pkg.Package{
Metadata: pkg.LuaRocksPackage{},
},
originator: "",
supplier: "",
},
{
name: "from npm",
input: pkg.Package{
@@ -6,7 +6,7 @@ import (
"github.com/anchore/syft/syft/pkg"
)
//nolint:funlen
//nolint:funlen, gocyclo
func SourceInfo(p pkg.Package) string {
answer := ""
switch p.Type {
@@ -58,6 +58,8 @@ func SourceInfo(p pkg.Package) string {
answer = "acquired package info from nix store path"
case pkg.Rpkg:
answer = "acquired package info from R-package DESCRIPTION file"
case pkg.LuaRocksPkg:
answer = "acquired package info from Rockspec package file"
case pkg.SwiftPkg:
answer = "acquired package info from resolved Swift package manifest"
case pkg.GithubActionPkg, pkg.GithubActionWorkflowPkg:
@@ -247,6 +247,14 @@ func Test_SourceInfo(t *testing.T) {
"acquired package info from R-package DESCRIPTION file",
},
},
{
input: pkg.Package{
Type: pkg.LuaRocksPkg,
},
expected: []string{
"acquired package info from Rockspec package file",
},
},
{
input: pkg.Package{
Type: pkg.SwiftPkg,