Internal

internal/adapters/cli/review

Package review selects review providers and pass agendas for the CLI adapter.

import "github.com/nilstate/scafld/v2/internal/adapters/cli/review"

Package review selects review providers and pass agendas for the CLI adapter.

Functions

func FirstNonEmpty(values ...string) string

Source: internal/adapters/cli/review/options.go:47

FirstNonEmpty returns the first non-blank value.

func ModeFromFlags(mode string, verify bool, full bool) corereview.Mode

Source: internal/adapters/cli/review/options.go:11

ModeFromFlags resolves CLI mode flags into the provider review mode.

func PositiveInt(value string) int

Source: internal/adapters/cli/review/options.go:26

PositiveInt parses non-negative integer CLI values. Invalid values use the unset value because review budgets are advisory, not gate inputs.

func PositiveOrDefault(value int, fallback int) int

Source: internal/adapters/cli/review/options.go:39

PositiveOrDefault returns fallback when value is unset.

func PrintHelp(w io.Writer)

Source: internal/adapters/cli/review/help.go:9

PrintHelp writes command-specific review help.

func Select(ctx context.Context, opts Options) (Selection, error)

Source: internal/adapters/cli/review/selection.go:45

Select loads config, applies CLI overrides, and returns a review provider.

func SplitScope(value string) []string

Source: internal/adapters/cli/review/scope.go:6

SplitScope parses comma-separated review scope paths.

Types

type Options

Source: internal/adapters/cli/review/selection.go:22

Options configures review-provider selection for the CLI.

type Options struct {
	Root            string
	TaskID          string
	Provider        string
	Command         string
	ProviderBinary  string
	Model           string
	DiagnosticsPath string
	Progress        io.Writer
	PrintContext    bool
}
Fields
  • Root string
  • TaskID string
  • Provider string
  • Command string
  • ProviderBinary string
  • Model string
  • DiagnosticsPath string
  • Progress io.Writer
  • PrintContext bool

type Selection

Source: internal/adapters/cli/review/selection.go:35

Selection is the provider and review agenda chosen for a review run.

type Selection struct {
	Provider        appreview.Provider
	Passes          []appreview.Pass
	Invariants      map[string]string
	ContextSections []reviewcontext.Section
	ContextMaxBytes int
	Dossier         configadapter.ReviewDossierConfig
}
Fields
  • Provider appreview.Provider
  • Passes []appreview.Pass
  • Invariants map[string]string
  • ContextSections []reviewcontext.Section
  • ContextMaxBytes int
  • Dossier configadapter.ReviewDossierConfig