github.com/lineaje-labs/syft@v0.98.1-0.20231227153149-9e393f60ff1b/syft/pkg/cataloger/haskell/cataloger.go (about)

     1  /*
     2  Package haskell provides a concrete Cataloger implementation relating to packages within the Haskell language ecosystem.
     3  */
     4  package haskell
     5  
     6  import (
     7  	"github.com/anchore/syft/syft/pkg"
     8  	"github.com/anchore/syft/syft/pkg/cataloger/generic"
     9  )
    10  
    11  // TODO: it seems that the stack.yaml/stack.lock/cabal.project.freeze have different purposes and could have different installation intentions
    12  // (some describe intent and are meant to be used by a tool to resolve more dependencies while others describe the actual installed state).
    13  // This hints at splitting these into multiple catalogers, but for now we'll keep them together.
    14  
    15  // NewHackageCataloger returns a new Haskell cataloger object.
    16  func NewHackageCataloger() pkg.Cataloger {
    17  	return generic.NewCataloger("haskell-cataloger").
    18  		WithParserByGlobs(parseStackYaml, "**/stack.yaml").
    19  		WithParserByGlobs(parseStackLock, "**/stack.yaml.lock").
    20  		WithParserByGlobs(parseCabalFreeze, "**/cabal.project.freeze")
    21  }