Documentation
¶
Overview ¶
Package universe reads the universe register of spec 18.3 and counts the outcomes of each scope.
The universe is the set of all source items of programming knowledge. Each card of cards/ and each node of nodes/ is a universe item with the outcome card or node, so the register does not repeat them. The files registers/universe/<source>.jsonl hold the other rows: the items that are aliases, sections, merged, on another site, out of scope, not an item, or still pending.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Outcomes = []string{"node", "card", "alias", "section", "merged", "disambiguation", "elsewhere:algorithm", "elsewhere:math2", "out-of-scope", "not-an-item", "pending"}
Outcomes are the outcomes of spec 18.3. The outcomes node and card come from nodes and cards, but a row may also use them to record a source name that maps to a node or card with another id.
var Reasons = []string{"not-programming", "product-marketing", "personal", "too-small"}
Reasons are the reason codes of the outcome out-of-scope.
var Scopes = []string{"languages", "releases", "concepts", "features", "api", "diagnostics", "proposals", "tasks", "patterns", "weaknesses", "tools", "libraries", "formats", "licences", "people", "terms"}
Scopes are the scopes of spec 18.4.
Functions ¶
func Gate ¶
Gate tells if the counts meet the exit criteria of M1 (spec 21): less than max of all items pending, and no pending item in the strict scopes. It returns the reasons when they are not met.
func ScopeOfKind ¶
ScopeOfKind returns the scope of the nodes and cards of a kind, or "" for a kind that is not a universe item, such as area.
Types ¶
type Count ¶
type Count struct {
Scope string `json:"scope"`
Total int `json:"total"`
Pending int `json:"pending"`
ByOutcome map[string]int `json:"by_outcome"`
}
Count holds the outcomes of one scope.
type Problem ¶
Problem is one problem of a row, with the check rule that finds it.
type Row ¶
type Row struct {
// Source is the id of the source, such as pldb or cwe. An empty source takes the name of the file.
Source string `json:"source,omitempty"`
// ID is the id of the item in the source, and Name is the name that the source gives it.
ID string `json:"id"`
Name string `json:"name,omitempty"`
// Scope is one of Scopes.
Scope string `json:"scope"`
// Outcome is one of Outcomes.
Outcome string `json:"outcome"`
// Target is the slug of the node or card that the row points to, or the tag on the other site for elsewhere outcomes.
Target string `json:"target,omitempty"`
// Reason says why the row has its outcome. Out of scope needs a reason code.
Reason string `json:"reason,omitempty"`
// Rule is the id of the rule of registers/scope-rules.yaml for the reason too-small.
Rule string `json:"rule,omitempty"`
File string `json:"-"`
Line int `json:"-"`
}
Row is one row of registers/universe/<source>.jsonl.