apply

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package apply executes the reviewer's verdicts against the git working tree: approved items are left alone, rejected items are reverted (via `git checkout <base_ref> -- <path>` for tracked files, or `os.Remove` for untracked-added files). Returns the verdict JSON the agent consumes from stdout.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileVerdict

type FileVerdict struct {
	Path    string `json:"path"`
	Status  string `json:"status"` // "approved" | "rejected"
	Comment string `json:"comment,omitempty"`
}

FileVerdict is the per-file outcome reported to the agent.

type Result

type Result struct {
	Verdicts []FileVerdict `json:"verdicts"`
}

Result is the top-level JSON shape emitted on stdout by `snapdiff await`.

func Apply

func Apply(ctx context.Context, repoDir, baseRef string, items []*review.Item) (Result, error)

Apply runs the verdict actions against repoDir's working tree and returns the verdict list. baseRef is the git ref used to restore rejected modifications and deletions (typically "HEAD").

Jump to

Keyboard shortcuts

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