Documentation
¶
Overview ¶
Package vet holds vis vet's checks, as go/analysis analyzers: the mistakes in using vis that compile and run but are wrong. Each says how to fix it. Test files are not checked: tests declare objectives and rules freely, often wrong on purpose.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Analyzers = []*analysis.Analyzer{Directives, KnobInit, Rules, SLOs}
Analyzers are vis vet's checks, in the order they run.
var Directives = &analysis.Analyzer{
Name: "visdirectives",
Doc: "check // vis: directives and that vis_gen.go is up to date with them",
Run: runDirectives,
}
Directives checks every // vis: directive, as vis gen reads them, and that vis_gen.go is what they generate.
var KnobInit = &analysis.Analyzer{
Name: "visknobinit",
Doc: "check that knobs aren't read, or copied before vis gen declares them, during package initialization",
Run: runKnobInit,
}
KnobInit checks for knobs read during package initialization, and for knobs and gauges vis gen declares being used before its init runs.
var Rules = &analysis.Analyzer{
Name: "visrules",
Doc: "check vis.RuleSpec literals against their knob and what they watch",
Run: runRules,
}
Rules checks hand-written rules: a knob rules may change, and a threshold and dead band in the unit of what the rule watches.
var SLOs = &analysis.Analyzer{
Name: "visslos",
Doc: "check that each SLO, and each route a rule watches, names a route its package registers",
Run: runSLOs,
}
SLOs checks that an objective names a route a handler in its package is registered under.
Functions ¶
This section is empty.
Types ¶
This section is empty.