report

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasFailures

func HasFailures(s Summary) bool

HasFailures returns true when errors or critical findings exist.

func PassLabel

func PassLabel() string

PassLabel returns PASS when severity is info-only success marker.

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.

type Result

type Result struct {
	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.

type Severity

type Severity string

Severity levels shared by doctor, analyze and check.

const (
	SeverityInfo     Severity = "info"
	SeverityWarning  Severity = "warning"
	SeverityError    Severity = "error"
	SeverityCritical Severity = "critical"
)

func (Severity) LegacySeverity

func (s Severity) LegacySeverity() string

LegacySeverity maps to PASS/WARNING/ERROR/INFO display labels.

type Summary

type Summary struct {
	Pass     int `json:"pass"`
	Info     int `json:"info"`
	Warning  int `json:"warning"`
	Error    int `json:"error"`
	Critical int `json:"critical"`
}

func BuildSummary

func BuildSummary(findings []Finding) Summary

BuildSummary counts findings by severity.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL