plumbing

package
v0.0.0-...-cd37b43 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package plumbing defines shared types, constants, and test helpers for the analysis pipeline.

Index

Constants

View Source
const (
	// DependencyFileDiff is the name of the dependency provided by FileDiff.
	DependencyFileDiff = "file_diff"

	// DependencyTreeChanges is the name of the dependency provided by TreeDiff.
	DependencyTreeChanges = "changes"

	// DependencyTick is the name of the dependency which DaysSinceStart provides - the number
	// of ticks since the first commit in the analyzed sequence.
	DependencyTick = "tick"

	// FactCommitsByTick contains the mapping between day indices and the corresponding commits.
	FactCommitsByTick = "TicksSinceStart.Commits"

	// FactTickSize contains the [time.Duration] of each tick.
	FactTickSize = "TicksSinceStart.TickSize"

	// DependencyBlobCache identifies the dependency provided by BlobCache.
	DependencyBlobCache = "blob_cache"

	// DependencyLanguages is the name of the dependency provided by LanguagesDetection.
	DependencyLanguages = "languages"

	// DependencyLineStats is the identifier of the data provided by LinesStatsCalculator - line
	// statistics for each file in the commit.
	DependencyLineStats = "line_stats"
)

Variables

View Source
var ErrBinary = gitlib.ErrBinary

ErrBinary is raised in CachedBlob.CountLines() if the file is binary.

Functions

func GetCommitsByTick

func GetCommitsByTick(facts map[string]any) (map[int][]gitlib.Hash, bool)

GetCommitsByTick extracts the commits-by-tick mapping from the facts map.

func GetPeopleCount

func GetPeopleCount(facts map[string]any) (int, bool)

GetPeopleCount extracts the unique author count from the facts map.

func GetReversedPeopleDict

func GetReversedPeopleDict(facts map[string]any) ([]string, bool)

GetReversedPeopleDict extracts the reversed people dictionary from the facts map.

func GetTickSize

func GetTickSize(facts map[string]any) (time.Duration, bool)

GetTickSize extracts the tick duration from the facts map.

Types

type CachedBlob

type CachedBlob = gitlib.CachedBlob

CachedBlob is an alias for gitlib.CachedBlob for backward compatibility.

type FileDiffData

type FileDiffData struct {
	Diffs          []diffmatchpatch.Diff
	OldLinesOfCode int
	NewLinesOfCode int
}

FileDiffData is the type of the dependency provided by FileDiff.

type LineStats

type LineStats struct {
	// Added is the number of added lines by a particular developer in a particular day.
	Added int `json:"added" yaml:"added"`
	// Removed is the number of removed lines by a particular developer in a particular day.
	Removed int `json:"removed" yaml:"removed"`
	// Changed is the number of changed lines by a particular developer in a particular day.
	Changed int `json:"changed" yaml:"changed"`
}

LineStats holds the numbers of inserted, deleted and changed lines.

Jump to

Keyboard shortcuts

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