diffapply

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(tree *model.SummaryTree, dd *diff.DiffData, logger *slog.Logger)

Apply annotates a model.SummaryTree with diff information. It resolves paths from the diff data, finds corresponding file nodes in the tree, and attaches change details like kind (added/modified) and changed line numbers.

Types

type Resolver

type Resolver interface {
	// Resolve attempts to map a diff path to a tree path
	// Returns the resolved path and whether resolution was successful
	Resolve(diffPath string) (treeRel string, ok bool)
}

Resolver maps paths from diff files to paths in the coverage tree

func BuildResolver

func BuildResolver(dd *diff.DiffData, fileIndex map[string]*model.FileNode, coveredSet map[string]bool, logger *slog.Logger) Resolver

BuildResolver creates a new Resolver using multiple heuristics: H1: Strip N leading components that gives most exact matches H2: Remove longest common prefix from monorepo root H3: Match by basename and suffix components H4: Prefer paths with known coverage in ambiguous cases

Jump to

Keyboard shortcuts

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