Skip to main content

Crate buildfix_edit

Crate buildfix_edit 

Source
Expand description

Edit engine for buildfix plans.

Responsibilities:

  • Attach file preconditions (sha256) to a plan.
  • Apply operations (in-memory or to disk) using toml_edit.
  • Generate a unified diff preview.

Structs§

ApplyOptions
AttachPreconditionsOptions
Options for attaching preconditions to a plan.

Enums§

EditError
The top-level error type for buildfix-edit operations.
PolicyBlockError
Policy block errors that should result in exit code 2.

Functions§

apply_op_to_content
Applies a single operation to TOML content, returning the modified content.
apply_plan
Apply a plan. When opts.dry_run is true, no files are written, but results and a patch are still produced.
attach_preconditions
Attach plan-level preconditions (FileSha256) for each file touched by ops.
check_policy_block
Checks if an apply result indicates a policy block.
execute_plan_from_contents
Execute a plan against pre-loaded file contents (no filesystem access).
get_head_sha
Get the current git HEAD SHA for a repository.
is_working_tree_dirty
Check if the git working tree has uncommitted changes.
preview_patch

Type Aliases§

EditResult
Result type alias using EditError.