coverage

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package coverage places every gathered PR and change with its nearest proposed capability, by the files it touches against the files and clusters the capability's own citations touch, so recovery reads all of them and not only what propose cited. It also says what no capability got: the gathered PRs placed nowhere, and the clusters of files no capability's citations touch. It is deterministic and starts no session.

Index

Constants

View Source
const Low = 20

Low is the share of gathered PRs, or of clusters, left with no capability past which coverage is low, in percent. A first guess, to be tuned from real runs.

Variables

This section is empty.

Functions

func PROf

func PROf(ch store.GatheredChange) int

PROf is the number of the PR change ch came from, or 0.

func Place

func Place(g store.Gather, caps []mapping.Capability) (Placement, Report)

Place places each gathered PR and change no capability cites with the capability whose footprint holds the most of its files, then the most of its files' directories; a tie goes to the capability proposed first, and one that touches none is placed nowhere. A PR's files are those of the changes that name it. It returns the placement and the report.

func Text

func Text(r Report) string

Text is r for a person: what propose cited, what was placed by files and what was left, the clusters no capability touches, the largest first, and, when coverage is low, that it is.

func Warn

func Warn(w io.Writer, r Report)

Warn says on w, as init's warning, when r's coverage is low; init goes on.

Types

type Placement

type Placement struct {
	PRs     map[string][]int
	Changes map[string][]string // full ids
}

Placement is what each capability reads beyond its citations, by name: the PRs and changes placed with it.

type Report

type Report struct {
	PRs       int               `json:"prs"`
	Cited     int               `json:"cited"`
	Placed    int               `json:"placed"`
	Unplaced  int               `json:"unplaced"`
	Unfiled   int               `json:"unfiled"`
	Clusters  int               `json:"clusters"`
	Uncovered []reading.Cluster `json:"uncovered"`
	Low       bool              `json:"low"`
}

Report is how far the proposal reaches into the gather. Cited counts the gathered PRs some capability cites, Placed those placed by their files, and Unplaced those neither, Unfiled of them because no gathered change names the PR, so it has no files to place it by. Clusters counts the clusters of files that change together, and Uncovered lists those no capability's citations touch, each with its first reading.ClusterPaths paths.

Jump to

Keyboard shortcuts

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