Documentation
¶
Overview ¶
Package report represents the outcome of validating a plugin or marketplace manifest. A Report is a file-level container of Findings; each Finding names a single rule violation with enough context that a human or CI can act on it without reading the source.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finding ¶
type Finding struct {
// Severity is error or warning.
Severity Severity `json:"severity"`
// Rule is a short machine-readable identifier, e.g. "HANKO001".
// Stable across releases so CI scripts can pin on it.
Rule string `json:"rule"`
// Path is a JSON Pointer into the manifest ("/name", "/plugins/0/source"),
// or empty when the rule is file-level.
Path string `json:"path,omitempty"`
// Message describes what's wrong in one sentence.
Message string `json:"message"`
// Fix is a one-line human-readable suggestion. Optional.
Fix string `json:"fix,omitempty"`
// DocURL points at the authoritative docs for the rule. Optional.
DocURL string `json:"doc_url,omitempty"`
}
Finding is a single rule violation.
type Report ¶
type Report struct {
// File is the path that was validated.
File string `json:"file"`
// Kind identifies which schema was applied ("plugin" or "marketplace").
Kind string `json:"kind"`
// Marketplace is the --marketplace flag value if any marketplace-specific
// rules were layered on top of the base schema. Empty otherwise.
Marketplace string `json:"marketplace,omitempty"`
// Findings is the ordered list of rule violations.
Findings []Finding `json:"findings"`
}
Report is a file-level aggregation of findings.
func (*Report) HasErrors ¶
HasErrors returns true if any finding is SeverityError. This is what drives the CLI exit code.
func (*Report) HasFindings ¶
HasFindings returns true if the report contains at least one finding of any severity.
type Severity ¶
type Severity int
Severity classifies how seriously a Finding should be taken.
func (Severity) MarshalJSON ¶
MarshalJSON emits the string form. CI consumers (including the bundled GitHub Action) compare `severity == "error"`, so the default int marshaling of the underlying type would silently break every consumer.
func (*Severity) UnmarshalJSON ¶
UnmarshalJSON accepts the string form emitted by MarshalJSON so the report JSON can round-trip through external tooling.