lockfile

package
v1.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package lockfile provides parsers for various JavaScript and Python lockfile formats.

Index

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

func FindLockfiles(dir string, recursive bool) ([]string, error)

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

func DetectAndParse(path string) (Lockfile, error)

DetectAndParse detects the lockfile format and parses it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL