diagnostic

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySeverity

func ApplySeverity(diags []Diagnostic, strict bool)

func Sort

func Sort(diags []Diagnostic)

func WriteHuman

func WriteHuman(w io.Writer, result Result) error

func WriteJSON

func WriteJSON(w io.Writer, result Result) error

Types

type Diagnostic

type Diagnostic struct {
	Code      string   `json:"code"`
	Severity  Severity `json:"severity"`
	File      string   `json:"file,omitempty"`
	Line      int      `json:"line,omitempty"`
	Column    int      `json:"column,omitempty"`
	Message   string   `json:"message"`
	Fix       string   `json:"fix,omitempty"`
	Reference string   `json:"reference,omitempty"`
	Kind      string   `json:"kind,omitempty"`
}

type Result

type Result struct {
	OK          bool         `json:"ok"`
	Strict      bool         `json:"strict"`
	Root        string       `json:"root"`
	Config      string       `json:"config,omitempty"`
	Entry       string       `json:"entry,omitempty"`
	Diagnostics []Diagnostic `json:"diagnostics"`
}

type Severity

type Severity string
const (
	SeverityWarning Severity = "warning"
	SeverityError   Severity = "error"
)

Jump to

Keyboard shortcuts

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