Documentation
¶
Index ¶
- func AttachManifestLocations(edges []models.DepsTreeEdge, deps []models.Dependency) []models.DepsTreeEdge
- func ChooseClosestWithManager(manifestDir, repoRoot string, detectors []DetectorWithManager) (*string, *string)
- func Detect(manifestDir, repoRoot string, lockfileNames ...string) *string
- func PathDepth(relPath string) int
- func PropagateDevFlag(edges []models.DepsTreeEdge, rootKey string)
- type DetectorFunc
- type DetectorWithManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachManifestLocations ¶ added in v0.0.2
func AttachManifestLocations(edges []models.DepsTreeEdge, deps []models.Dependency) []models.DepsTreeEdge
AttachManifestLocations stamps each lockfile edge's Location with the manifest-side LocationInfo (file + line in the manifest) for its dep. Direct edges (ParentKey == "") are matched by package name; transitive edges inherit the Location of the direct ancestor that pulled them in, resolved by walking the edge DAG to a fixed point.
Names are extracted from the AnalysisIdentifier ("package/<eco>/<name>") and the lockfile ChildKey ("package/<eco>/<name>?version=<v>"). Matching uses whatever normalization each ecosystem already applies (e.g. PEP 503 for pypi); both sides come from the same ecosystem and are pre-normalized by their respective parsers, so no extra normalization happens here.
func ChooseClosestWithManager ¶
func ChooseClosestWithManager(manifestDir, repoRoot string, detectors []DetectorWithManager) (*string, *string)
func PropagateDevFlag ¶
func PropagateDevFlag(edges []models.DepsTreeEdge, rootKey string)
PropagateDevFlag marks edges as Dev when their ChildKey is only reachable through dev root edges. Root edges are identified by ParentKey == rootKey.
Types ¶
type DetectorFunc ¶
type DetectorWithManager ¶
type DetectorWithManager struct {
Detect DetectorFunc
Manager string
}