Documentation
¶
Overview ¶
Package diagnostic defines the shared compiler diagnostic format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DynamicRule ¶
Types ¶
type Diagnostic ¶
type Diagnostic struct {
Rule string `json:"rule"`
Severity Severity `json:"severity"`
Location Location `json:"location"`
Element string `json:"element,omitempty"`
Path string `json:"path,omitempty"`
Message string `json:"message"`
Hint string `json:"hint"`
Related []Location `json:"related,omitempty"`
Reference string `json:"reference,omitempty"`
}
func Apply ¶
func Apply(issues []Diagnostic, overrides map[string]Severity) []Diagnostic
Apply makes lifecycle notices obey the same policy as normal quality rules. Required execution failures are never passed here as optional notices.
func HardOnly ¶
func HardOnly(issues []Diagnostic) []Diagnostic
func (Diagnostic) String ¶
func (d Diagnostic) String() string
type Location ¶
type RuleInfo ¶
type RuleInfo struct {
ID string `json:"id"`
Summary string `json:"summary"`
Help string `json:"help"`
Required bool `json:"required,omitempty"`
Project string `json:"project,omitempty"` // Needs the lfm project's sources.
}
RuleInfo is the single definition of a rule's identity and help. Summary is one line naming what is checked; Help explains what triggers it, why it matters and how to resolve it. Required rules can never leave error level.
func OperationalRules ¶
func OperationalRules() []RuleInfo
OperationalRules are emitted outside individual HTML/template checks. Lighthouse owns a versioned audit namespace, so its concrete IDs are dynamic.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source indexes line starts once for repeated source-position lookups. Columns/offsets use UTF-8 bytes, matching Go's template and JSON parsers.
type Summary ¶
type Summary struct {
Diagnostics []Diagnostic `json:"diagnostics"`
Errors int `json:"errors"`
Warnings int `json:"warnings"`
}
func Summarize ¶
func Summarize(issues []Diagnostic) Summary