Documentation
¶
Overview ¶
Package lockfile provides parsers for various JavaScript and Python lockfile formats.
Index ¶
- func Discover(dir string, recursive bool) (lockfiles []string, gaps []types.CoverageGap, ...)
- func FindLockfiles(dir string, recursive bool) ([]string, error)
- func FindUnlockedManifests(dir string, recursive bool) (gaps []types.CoverageGap, covered []types.WorkspaceCoverage, err error)
- type CoverageReporter
- type Lockfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Discover ¶ added in v1.16.0
func Discover(dir string, recursive bool) (lockfiles []string, gaps []types.CoverageGap, covered []types.WorkspaceCoverage, err error)
Discover walks dir once and returns the lockfile paths to scan together with the workspace-aware coverage classification. It is the single-walk equivalent of FindLockfiles followed by FindUnlockedManifests, so the scanner stats the tree only once.
func FindLockfiles ¶
FindLockfiles searches a directory for lockfiles. If recursive is true, it searches subdirectories as well.
func FindUnlockedManifests ¶ added in v1.16.0
func FindUnlockedManifests(dir string, recursive bool) (gaps []types.CoverageGap, covered []types.WorkspaceCoverage, err error)
FindUnlockedManifests classifies dependency manifests that have no co-located lockfile for their ecosystem. A manifest that is a member of a workspace whose root lockfile we scanned is reported as workspace-covered (its deps were audited via that root); the rest are coverage gaps that cannot be audited. It honours the same skip rules as FindLockfiles.
Types ¶
type CoverageReporter ¶ added in v1.16.0
type CoverageReporter interface {
CoverageGaps() []types.CoverageGap
}
CoverageReporter is implemented by parsers that can report dependency sources they saw but could not turn into auditable pinned dependencies.
type Lockfile ¶
type Lockfile interface {
// Type returns the lockfile format identifier.
Type() string
// Path returns the file path of the lockfile.
Path() string
// Dependencies returns all dependencies from the lockfile.
Dependencies() []types.Dependency
}
Lockfile represents a parsed Lockfile.
func DetectAndParse ¶
DetectAndParse detects the lockfile format and parses it.