Documentation
¶
Overview ¶
Package prcheck runs the PR check of design 07 section 5 on a range: every change names exactly one capability whose slug is in the map as that change leaves it, and the map passes physa check map. It holds the result, each commit with the capability it names, the trailer findings and the map's problems, and renders it as a short markdown summary. It reports; whether a finding blocks is the caller's policy.
Index ¶
Constants ¶
const ( PRAnchorsGitHub = mapcheck.PRAnchorsGitHub PRAnchorsFormOnly = mapcheck.PRAnchorsFormOnly )
How the map's PR anchors were checked.
const Version = 3
Version is the version of the result's JSON shape.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MapResult ¶
type MapResult struct {
Problems []Problem `json:"problems"`
PRAnchors string `json:"pr_anchors"` // PRAnchorsGitHub or PRAnchorsFormOnly
Note string `json:"note,omitempty"`
}
MapResult is the map's check as the PR leaves it.
type Problem ¶
type Problem struct {
Path string `json:"path"`
Line int `json:"line"`
Message string `json:"message"`
}
Problem is one problem the map check found.
type Result ¶
type Result struct {
Version int `json:"version"`
Range string `json:"range"`
Commits []history.Commit `json:"commits"`
Findings []history.Finding `json:"findings"`
Map MapResult `json:"map"`
}
Result is what the deterministic PR check found.
func Run ¶
Run checks the range rng of repo against the map under dir, the repo's working directory: the commits' trailers against the map as each commit leaves it, and the map's own check, with commit anchors resolved in repo and #N anchors through prExists (nil checks them for form only). The error is for a map, a history or a range that cannot be read.
func (Result) Clean ¶
Clean reports whether the check found nothing: no trailer findings and no map problems.
func (Result) MarshalJSON ¶
MarshalJSON encodes empty commits, findings and problems as [], never null.