Documentation
¶
Index ¶
Constants ¶
const JSONSchemaVersion = "1"
JSONSchemaVersion is the current JSON output schema version. Increment when making breaking changes to the JSON output format.
Variables ¶
This section is empty.
Functions ¶
func HasFailures ¶
HasFailures returns true when errors or critical findings exist.
Types ¶
type Finding ¶
type Finding struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Category string `json:"category"`
Severity Severity `json:"severity"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
Column int `json:"column,omitempty"`
Message string `json:"message"`
Explanation string `json:"explanation,omitempty"`
Suggestion string `json:"suggestion,omitempty"`
}
Finding is a single diagnostic from any ForgeKit command.
func UniqueFindings ¶ added in v0.3.0
UniqueFindings removes duplicate findings while preserving order.
type Result ¶
type Result struct {
SchemaVersion string `json:"schema_version"`
Tool string `json:"tool"`
Version string `json:"version"`
Command string `json:"command"`
Project string `json:"project,omitempty"`
Timestamp time.Time `json:"timestamp"`
Summary Summary `json:"summary"`
Findings []Finding `json:"findings"`
}
Result is the stable JSON schema for machine-readable output. Used by analyze, doctor, check commands.
type Score ¶ added in v0.3.0
type Score struct {
Categories map[string]int `json:"categories"`
Global int `json:"global"`
Notes []string `json:"notes,omitempty"`
}
Score represents per-category scoring and global score.
func ComputeScore ¶ added in v0.3.0
ComputeScore computes simple category scores based on findings and project files. It uses deterministic rules and avoids magic numbers scattered in code.
type Severity ¶
type Severity string
Severity levels shared by doctor, analyze and check.
func (Severity) LegacySeverity ¶
LegacySeverity maps to PASS/WARNING/ERROR/INFO display labels.