Skip to content

Add codegenfiles module - #447

Open
bmoylan wants to merge 2 commits into
masterfrom
bm/codegenfiles
Open

Add codegenfiles module#447
bmoylan wants to merge 2 commits into
masterfrom
bm/codegenfiles

Conversation

@bmoylan

@bmoylanbmoylan commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

codegenfiles reconciles the output of a code generator against a directory: it writes the files whose content changed, leaves the rest alone, deletes output that is no longer generated, and preserves hand-written files that share the directory. Plan reads the filesystem without writing to it, so a tool's generate and verify modes are the same code path and verify cannot corrupt the tree it is checking.


This change is Reviewable

codegenfiles reconciles the output of a code generator against a
directory: it writes the files whose content changed, leaves the
rest alone, deletes output that is no longer generated, and
preserves hand-written files that share the directory. Plan reads
the filesystem without writing to it, so a tool's generate and
verify modes are the same code path and verify cannot corrupt the
tree it is checking.
@changelog-app

changelog-appBot commented Jul 27, 2026

Copy link
Copy Markdown

Generate changelog in changelog/@unreleased

Type(Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Add codegenfiles module

Check the box to generate changelog(s)

  • Generate changelog entry

@changelog-app

Copy link
Copy Markdown

Successfully generated changelog entry!

Need to regenerate?

Simply interact with the changelog bot comment again to regenerate these entries.


📋Changelog Preview

✨ Features

  • Add codegenfiles module (#447)

Cuts the package doc roughly in half. The code block duplicated the runnable
Example, and the list of generator output shapes collapsed because writing
through an interface of its own and registering a pluggable assembler are the
same move.
Adds what porting the first consumers turned up. Leaving ContentsMatcher nil is
the common case rather than the exception, so FileMatcher is usually the only
thing standing between DeleteStale and a hand-written file; a matcher bounded
tightly enough that it matches only the generated set leaves DeleteStale unable
to fire at all, which is safe but is not working stale-output handling; and
capturing a generator's output by pointing it at a scratch directory works only
if that output does not depend on where it was written.
Sign up for freeto 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.

1 participant

@bmoylan