github.com/anchore/syft@v1.38.2/cmd/syft/internal/options/dotnet.go (about)

     1  package options
     2  
     3  import (
     4  	"github.com/anchore/clio"
     5  	"github.com/anchore/syft/syft/pkg/cataloger/dotnet"
     6  )
     7  
     8  type dotnetConfig struct {
     9  	DepPackagesMustHaveDLL bool `mapstructure:"dep-packages-must-have-dll" json:"dep-packages-must-have-dll" yaml:"dep-packages-must-have-dll"`
    10  
    11  	DepPackagesMustClaimDLL bool `mapstructure:"dep-packages-must-claim-dll" json:"dep-packages-must-claim-dll" yaml:"dep-packages-must-claim-dll"`
    12  
    13  	PropagateDLLClaimsToParents bool `mapstructure:"propagate-dll-claims-to-parents" json:"propagate-dll-claims-to-parents" yaml:"propagate-dll-claims-to-parents"`
    14  
    15  	RelaxDLLClaimsWhenBundlingDetected bool `mapstructure:"relax-dll-claims-when-bundling-detected" json:"relax-dll-claims-when-bundling-detected" yaml:"relax-dll-claims-when-bundling-detected"`
    16  }
    17  
    18  var _ interface {
    19  	clio.FieldDescriber
    20  } = (*dotnetConfig)(nil)
    21  
    22  func (o *dotnetConfig) DescribeFields(descriptions clio.FieldDescriptionSet) {
    23  	descriptions.Add(&o.DepPackagesMustHaveDLL, `only keep dep.json packages which an executable on disk is found. The package is also included if a DLL is found for any child package, even if the package itself does not have a DLL.`)
    24  	descriptions.Add(&o.DepPackagesMustClaimDLL, `only keep dep.json packages which have a runtime/resource DLL claimed in the deps.json targets section (but not necessarily found on disk). The package is also included if any child package claims a DLL, even if the package itself does not claim a DLL.`)
    25  	descriptions.Add(&o.PropagateDLLClaimsToParents, `treat DLL claims or on-disk evidence for child packages as DLL claims or on-disk evidence for any parent package`)
    26  	descriptions.Add(&o.RelaxDLLClaimsWhenBundlingDetected, `show all packages from the deps.json if bundling tooling is present as a dependency (e.g. ILRepack)`)
    27  }
    28  
    29  func defaultDotnetConfig() dotnetConfig {
    30  	def := dotnet.DefaultCatalogerConfig()
    31  	return dotnetConfig{
    32  		DepPackagesMustHaveDLL:             def.DepPackagesMustHaveDLL,
    33  		DepPackagesMustClaimDLL:            def.DepPackagesMustClaimDLL,
    34  		PropagateDLLClaimsToParents:        def.PropagateDLLClaimsToParents,
    35  		RelaxDLLClaimsWhenBundlingDetected: def.RelaxDLLClaimsWhenBundlingDetected,
    36  	}
    37  }