Skip to content

refactor: split generate() into plan and execute phases#64

Merged
raiderrobert merged 1 commit into
mainfrom
refactor/generate-plan-execute
Feb 14, 2026
Merged

refactor: split generate() into plan and execute phases#64
raiderrobert merged 1 commit into
mainfrom
refactor/generate-plan-execute

Conversation

@raiderrobert

@raiderrobert raiderrobert commented Feb 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Factor walk_and_render() into plan_render() + execute_plan() — renders all files in memory first, then writes to disk as a separate step
  • Factor generate() into plan_generation() + execute_generation() — aligns new command architecture with update's existing three_way_merge()apply_merge() pattern
  • No behavior change — all 30 existing tests pass unmodified, 3 new tests added

Motivation

Enables dry-run support for the new command (see #62) by separating what-would-happen from actually-doing-it. This is a prerequisite refactor.

Test plan

  • cargo test — all 33 tests pass (30 existing + 3 new)
  • cargo clippy -- -D warnings — no warnings
  • New test_plan_render_matches_walk_and_render verifies byte-for-byte identical output
  • New test_plan_render_file_counts verifies correct rendered/copied counts
  • New test_plan_render_conditional_exclude verifies conditional file exclusion in plan phase

Closes #61
Blocks #62

Factor walk_and_render() into plan_render() + execute_plan(), and
generate() into plan_generation() + execute_generation(). This
separates what-would-happen from actually-doing-it, enabling
dry-run support for the new command in a follow-up PR.

No behavior change — all existing tests pass unmodified.

Closes #61
@raiderrobert raiderrobert merged commit fae7944 into main Feb 14, 2026
10 checks passed
@raiderrobert raiderrobert deleted the refactor/generate-plan-execute branch February 14, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: split generate() into plan and execute phases

1 participant