Documentation
¶
Overview ¶
Package gitdiff computes the set of added/changed lines per file between a base ref and the working tree, for "new code" (Clean-as-You-Code) gating: a finding is "new" when it sits on a changed line. It shells out to git (argv only, no shell) and parses a --unified=0 diff. Read-only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileAtRevision ¶ added in v0.1.8
FileAtRevision returns one base-side file while the scan workspace still exists.
func FileChanges ¶ added in v0.1.8
func FileChanges(ctx context.Context, dir, base, head string) ([]projectanalysis.FileChange, error)
FileChanges returns normalized immutable Git changes between two already-resolved revisions. It uses argv-only Git and never consults the working tree at read time.
Types ¶
type ChangedLines ¶
ChangedLines maps a repo-relative file path to the set of its added/changed 1-based line numbers.
type ComparisonSource ¶ added in v0.1.8
type ComparisonSource struct{}
ComparisonSource adapts Git-backed comparison reads to the use-case port.
func (*ComparisonSource) FileAtRevision ¶ added in v0.1.8
func (*ComparisonSource) FileChanges ¶ added in v0.1.8
func (*ComparisonSource) FileChanges(ctx context.Context, dir, base, head string) ([]projectanalysis.FileChange, error)