compute

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockID_ForLine

func BlockID_ForLine(project *model.ProjectAnnotation)

convert block labels to line labels the map: <line,label> -> true|false the map will not be very huge, but it will certainly repeat how to resolve that? id is just a trick to reduce repeation

func Changed_ForLineFromChanges

func Changed_ForLineFromChanges(project *model.ProjectAnnotation)

func Changed_Line2Func

func Changed_Line2Func(project *model.ProjectAnnotation)

depends: BuildLineToFunctionMapping

func CodeExcludedForFunc

func CodeExcludedForFunc(project *model.ProjectAnnotation)

Comments to func

func CodeExcludedFuncToLine

func CodeExcludedFuncToLine(project *model.ProjectAnnotation)

func CoverageLabels_ForLine

func CoverageLabels_ForLine(project *model.ProjectAnnotation, labelOptions map[string]*LabelOption)

optional: AnnotationType_LineLabels

func CoverageLabels_Line2Func

func CoverageLabels_Line2Func(project *model.ProjectAnnotation)

func EnsureBlockID_ForLine

func EnsureBlockID_ForLine(project *model.ProjectAnnotation)

func EnsureCodeExcludedForFunc

func EnsureCodeExcludedForFunc(project *model.ProjectAnnotation)

func EnsureCodeExcludedFuncToLine

func EnsureCodeExcludedFuncToLine(project *model.ProjectAnnotation)

func EnsureCoverageLabels_ForLine

func EnsureCoverageLabels_ForLine(project *model.ProjectAnnotation, labelOptions map[string]*LabelOption)

func EnsureCoverageLabels_Line2Func

func EnsureCoverageLabels_Line2Func(project *model.ProjectAnnotation)

func EnsureExecLabels_Block2Line

func EnsureExecLabels_Block2Line(project *model.ProjectAnnotation)

func EnsureFuncID_ForLine

func EnsureFuncID_ForLine(project *model.ProjectAnnotation)

func EnsureUncoverable_ForLine

func EnsureUncoverable_ForLine(project *model.ProjectAnnotation)

func ExecLabels_Block2Line

func ExecLabels_Block2Line(project *model.ProjectAnnotation)

from: File.Blocks.ExecLabels, File.Line.BlockID generate: File.Lines.ExecLabels

func ExecLabels_Line2Func

func ExecLabels_Line2Func(project *model.ProjectAnnotation)

depends: File.Lines.ExecLabels generate: FuncAnnotation.ExecLabels

func FuncID_ForLine

func FuncID_ForLine(project *model.ProjectAnnotation)

func LabelsOnTheFly

func LabelsOnTheFly(project *model.ProjectAnnotation)

LabelsOnTheFly on the fly because these processes are lightweight the compute is simply, but the storage is massive so named with on the fly

func Labels_Line2Func

func Labels_Line2Func(project *model.ProjectAnnotation)

depends: File.Lines.Labels generate: FuncAnnotation.Labels

func LineChangesMergeExecLabels

func LineChangesMergeExecLabels(base *model.ProjectAnnotation, changesForBase *model.ProjectAnnotation, oldData *model.ProjectAnnotation)

func LineChangesMergeExecLabelsOnlyChanged

func LineChangesMergeExecLabelsOnlyChanged(base *model.ProjectAnnotation, changesForBase *model.ProjectAnnotation, oldData *model.ProjectAnnotation)

func LineChangesMergeExecLabelsOnlyUnchanged

func LineChangesMergeExecLabelsOnlyUnchanged(base *model.ProjectAnnotation, changesForBase *model.ProjectAnnotation, oldData *model.ProjectAnnotation)

func LineChangesMergeLineRemark

func LineChangesMergeLineRemark(base *model.ProjectAnnotation, changesForBase *model.ProjectAnnotation, oldData *model.ProjectAnnotation)

LineChangesMergeLineRemark try best effort to map old line data to new line data

func LineUncoverable

func LineUncoverable(lineData *model.LineAnnotation) bool

func Uncoverable_ForLine

func Uncoverable_ForLine(project *model.ProjectAnnotation)

Types

type DiffCallback

type DiffCallback = func(oldLineStart, oldLineEnd, newLineStart, newLineEnd int, changeType diff.ChangeType)

func MergeLabelsDiffCallback

func MergeLabelsDiffCallback(opts *MergeOptions) DiffCallback

type LabelOption

type LabelOption struct {
	DisplayName string // when not empty, use it instead
	Alias       map[string]bool
	MatchMode   MatchMode // need match exec label
}

type MatchMode

type MatchMode string
const (
	MatchMode_Exact MatchMode = "" // default is exact
	MatchMode_Any   MatchMode = "any"
)

type MergeOptions

type MergeOptions struct {
	IncludeUnchanged bool
	// IncludeChanged vs IncludeChangedAsMapping
	// range: oldA~oldB newA~newB
	// IncludeChanged:          each ln in newA~newB, map ln -> oldA~oldB
	// IncludeChangedAsMapping:  map common prefix of newA~newB and oldA~oldB
	IncludeChanged          bool
	IncludeChangedAsMapping bool
	ShouldIncludeLine       func(line int) bool

	// oldLineStart inclsuive,oldLineEnd exclusive
	MergeLine func(newLine int64, oldLineStart int64, oldLineEnd int64)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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