Documentation
¶
Overview ¶
Package diff provides semantic diff engines for pixi.toml and pixi.lock files.
The TOML diff engine parses pixi.toml files structurally and produces semantic diffs (e.g., "numpy upgraded from 2.0 to 2.4") rather than raw line-by-line text diffs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatLockDiffText ¶
func FormatLockDiffText(summary *LockSummary) string
FormatLockDiffText formats a LockSummary as detailed text with package lists.
func FormatUnifiedDiff ¶
FormatUnifiedDiff formats a TomlDiff as a unified diff string.
Types ¶
type Change ¶
type Change struct {
Section string `json:"section"`
Key string `json:"key"`
Type ChangeType `json:"type"`
OldValue string `json:"old_value,omitempty"`
NewValue string `json:"new_value,omitempty"`
}
Change represents a single semantic change in a TOML file.
type ChangeType ¶
type ChangeType string
ChangeType represents the type of change in a diff.
const ( ChangeAdded ChangeType = "added" ChangeRemoved ChangeType = "removed" ChangeModified ChangeType = "modified" )
type LockSummary ¶
type LockSummary struct {
PackagesAdded int `json:"packages_added"`
PackagesRemoved int `json:"packages_removed"`
PackagesUpdated int `json:"packages_updated"`
Added []string `json:"added,omitempty"`
Removed []string `json:"removed,omitempty"`
Updated []PackageUpdate `json:"updated,omitempty"`
}
LockSummary represents a summary of lock file changes.
func CompareLock ¶
func CompareLock(oldContent, newContent []byte) (*LockSummary, error)
CompareLock compares two pixi.lock file contents and produces a LockSummary. It parses the YAML structure and identifies added, removed, and updated packages.
type PackageUpdate ¶
type PackageUpdate struct {
Name string `json:"name"`
OldVersion string `json:"old"`
NewVersion string `json:"new"`
}
PackageUpdate represents a package version change.
type TomlDiff ¶
type TomlDiff struct {
Changes []Change `json:"changes"`
}
TomlDiff represents the semantic difference between two TOML files.
func CompareToml ¶
CompareToml parses two TOML contents and produces a semantic diff.
func (*TomlDiff) HasChanges ¶
HasChanges returns true if there are any differences.