review

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasFindingsAtOrAbove

func HasFindingsAtOrAbove(report ReviewReport, threshold query.RiskLevel) bool

HasFindingsAtOrAbove reports whether report should fail CI at threshold.

func HasFindingsAtOrAbovePrecision added in v0.6.0

func HasFindingsAtOrAbovePrecision(report ReviewReport, threshold query.AnalysisPrecision) bool

HasFindingsAtOrAbovePrecision reports whether findings meet a precision threshold.

func ParseAnalysisPrecision added in v0.6.0

func ParseAnalysisPrecision(s string) (query.AnalysisPrecision, error)

ParseAnalysisPrecision parses a CLI precision threshold.

func ParseRiskLevel

func ParseRiskLevel(s string) (query.RiskLevel, error)

ParseRiskLevel parses a CLI threshold.

func WriteGitHub

func WriteGitHub(w io.Writer, report ReviewReport) error

WriteGitHub writes GitHub Actions annotations for review findings.

func WriteJSON

func WriteJSON(w io.Writer, report ReviewReport) error

WriteJSON writes a stable machine-readable review report.

func WritePretty

func WritePretty(w io.Writer, report ReviewReport) error

WritePretty writes a human-readable review report.

Types

type Config added in v0.6.0

type Config struct {
	Manifest             string                          `json:"manifest,omitempty"`
	Schema               string                          `json:"schema,omitempty"`
	Policy               string                          `json:"policy,omitempty"`
	DatabaseSchema       string                          `json:"database_schema,omitempty"`
	Code                 []string                        `json:"code,omitempty"`
	RequireFreshManifest bool                            `json:"require_fresh_manifest,omitempty"`
	FailOn               string                          `json:"fail_on,omitempty"`
	FailOnPrecision      string                          `json:"fail_on_precision,omitempty"`
	ShowSuppressed       bool                            `json:"show_suppressed,omitempty"`
	Rules                map[string]query.RiskRuleConfig `json:"rules,omitempty"`
	Suppressions         []ConfigSuppression             `json:"suppressions,omitempty"`
}

Config is the JSON configuration accepted by goquent review --config.

func LoadConfig added in v0.6.0

func LoadConfig(path string) (Config, error)

LoadConfig reads a JSON review config file.

type ConfigSuppression added in v0.6.0

type ConfigSuppression struct {
	Code    string `json:"code"`
	Path    string `json:"path,omitempty"`
	Reason  string `json:"reason"`
	Owner   string `json:"owner,omitempty"`
	Expires string `json:"expires,omitempty"`
}

ConfigSuppression suppresses a finding for paths matched by Path.

type Finding

type Finding struct {
	Code              string                  `json:"code"`
	Level             query.RiskLevel         `json:"level"`
	Message           string                  `json:"message"`
	Location          *query.SourceLocation   `json:"location,omitempty"`
	Hint              string                  `json:"hint,omitempty"`
	Evidence          []query.Evidence        `json:"evidence,omitempty"`
	AnalysisPrecision query.AnalysisPrecision `json:"analysis_precision"`
	Suppressed        bool                    `json:"suppressed"`
	Suppression       *query.Suppression      `json:"suppression,omitempty"`
}

Finding is a review finding emitted by goquent review.

type ManifestStatus

type ManifestStatus struct {
	Fresh    bool   `json:"fresh"`
	Verified bool   `json:"verified,omitempty"`
	State    string `json:"state,omitempty"`
	Path     string `json:"path,omitempty"`
}

ManifestStatus is reserved for Phase 6 stale manifest integration.

type Options

type Options struct {
	Paths                []string
	ShowSuppressed       bool
	ManifestPath         string
	RequireFreshManifest bool
	CurrentManifest      *manifest.Manifest
	ManifestInputs       bool
	Rules                map[string]query.RiskRuleConfig
	ConfigSuppressions   []ConfigSuppression
}

Options controls review discovery and output behavior.

type ReviewReport

type ReviewReport struct {
	Findings           []Finding       `json:"findings"`
	SuppressedFindings []Finding       `json:"suppressed_findings,omitempty"`
	Summary            ReviewSummary   `json:"summary"`
	ManifestStatus     *ManifestStatus `json:"manifest_status,omitempty"`
}

ReviewReport is the top-level report produced by goquent review.

func Run

func Run(opts Options) (ReviewReport, error)

Run reviews all configured paths.

type ReviewSummary

type ReviewSummary struct {
	Total       int                     `json:"total"`
	Suppressed  int                     `json:"suppressed"`
	ByLevel     map[query.RiskLevel]int `json:"by_level,omitempty"`
	HighestRisk query.RiskLevel         `json:"highest_risk"`
}

ReviewSummary aggregates findings for machine-readable output and CI.

Jump to

Keyboard shortcuts

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