feat: implement haskell support (#1096)

This commit is contained in:
cpendery
2022-07-18 15:33:54 -04:00
committed by GitHub
parent 00e12329d0
commit 9b1adce19a
27 changed files with 985 additions and 0 deletions
@@ -6,6 +6,7 @@ import (
"github.com/anchore/syft/syft/pkg"
)
//nolint:funlen
func SourceInfo(p pkg.Package) string {
answer := ""
switch p.Type {
@@ -41,6 +42,8 @@ func SourceInfo(p pkg.Package) string {
answer = "acquired package info from conan manifest"
case pkg.PortagePkg:
answer = "acquired package info from portage DB"
case pkg.HackagePkg:
answer = "acquired package info from cabal or stack manifest files"
default:
answer = "acquired package info from the following paths"
}
@@ -174,6 +174,14 @@ func Test_SourceInfo(t *testing.T) {
"from portage DB",
},
},
{
input: pkg.Package{
Type: pkg.HackagePkg,
},
expected: []string{
"from cabal or stack manifest files",
},
},
}
var pkgTypes []pkg.Type
for _, test := range tests {