Documentation
¶
Overview ¶
Package coverage places each 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 them and not only what propose cited. A file many capabilities touch counts for little. An item is placed only when at least half its files, by weight, are near the capability, and chores (dependency bumps, CI, formatting) are never placed. 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 ¶
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.
MinShare is the share of an item's files, in percent, that must be in a capability's footprint or its directories for the item to be placed with it. A first guess, to be tuned from real runs.
Variables ¶
This section is empty.
Functions ¶
func Chore ¶ added in v0.0.5
Chore reports whether an item with this subject or title and these files is a chore: its subject says so, or every file it touches is a dependency file or CI, formatter or linter configuration.
func PROf ¶
func PROf(ch store.GatheredChange) int
PROf is the number of the PR change ch came from, or 0.
func Place ¶
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, each file weighed by how many footprints hold it (weights); a tie goes to the capability proposed first. An item is placed nowhere when less than MinShare percent of its files' weight is near that capability, when all its files are held by most footprints, or when it is a Chore. A PR's files are those of the changes that name it. It returns the placement and the report.
Types ¶
type Placement ¶
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"`
Chores int `json:"chores"`
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, and Chores of them because they are chores, which are never placed. 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.