verdict

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Overview

Package verdict reads and writes the verdict a run ends with.

Index

Constants

View Source
const (
	Pass            = "pass"
	Block           = "block"
	Human           = "human"
	BlockedExternal = "blocked-external"
)

The statuses a run can end with (docs/spec/role-contract.md, "Verdict").

Variables

This section is empty.

Functions

func Enforce

func Enforce(v *Verdict, enforce map[string]string)

Enforce applies a project's per-rule enforcement: "off" drops a finding, "warn" keeps it without blocking. A block whose findings are all warnings becomes a pass that still shows them.

func Write

func Write(path string, v *Verdict) error

Write saves a verdict file.

Types

type Finding

type Finding struct {
	Rule    string `yaml:"rule" json:"rule"`
	Where   string `yaml:"where,omitempty" json:"where,omitempty"`
	Message string `yaml:"message,omitempty" json:"message,omitempty"`
	Level   string `yaml:"level,omitempty" json:"level,omitempty"` // "warn" once enforcement downgraded it
}

Finding is one thing a check noticed.

type Verdict

type Verdict struct {
	Status   string    `yaml:"status" json:"status"`
	Summary  string    `yaml:"summary,omitempty" json:"summary,omitempty"`
	Findings []Finding `yaml:"findings,omitempty" json:"findings,omitempty"`
}

Verdict is the content of out/verdict.yaml.

func Read

func Read(path string) (*Verdict, error)

Read loads a verdict file.

Jump to

Keyboard shortcuts

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