finding

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package finding is skillet's shared diagnostic type: one Diagnostic that any linter or gate emits, carrying a Severity, an optional Category, an optional location Path, and a human Message. It replaces the per-tool finding types (exegesis lint's {Severity, Message}, modelith lint's four-field form) with one shape. A finding is a static diagnostic — not an adjudication hypothesis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort(ds []Diagnostic)

Sort orders diagnostics deterministically by severity, then category, then path, then message — so identical inputs always render in the same order. SeverityError sorts before SeverityWarning ("error" < "warning").

Types

type Diagnostic

type Diagnostic struct {
	Severity Severity `json:"severity"`
	Category string   `json:"category,omitempty"`
	Path     string   `json:"path,omitempty"`
	Message  string   `json:"message"`
}

Diagnostic is one finding about an artifact.

type Result

type Result struct {
	Diagnostics []Diagnostic `json:"diagnostics"`
}

Result accumulates diagnostics from one or more checks.

func (*Result) Add

func (r *Result) Add(d Diagnostic)

Add appends a diagnostic to the result.

func (*Result) HasBlocking

func (r *Result) HasBlocking() bool

HasBlocking reports whether any diagnostic is blocking (Severity error).

type Severity

type Severity string

Severity classifies a Diagnostic.

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

Severity levels. Only SeverityError is blocking.

func (Severity) Blocking

func (s Severity) Blocking() bool

Blocking reports whether s should fail a gate. Error blocks; warning does not.

func (Severity) Valid

func (s Severity) Valid() bool

Valid reports whether s is a known severity.

Jump to

Keyboard shortcuts

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