Skip to content

Fold ScriptRewriter into RewriteBootstrapScriptsStep #573

Closed

Description

@ChrisonSimtian

Problem

src/Fallout.Migrate/Steps/ mixes two shapes. Most files are migration steps that implement IMigrationStep. ScriptRewriter is a free-floating static class that is not a step — it only holds the rewrite rules for one step.

That split was the original design in #507, but it has since been retired one file at a time:

ScriptRewriter is the last one. It has exactly one caller, RewriteBootstrapScriptsStep.cs:26, so the same reasoning applies. Until it moves, Steps/ teaches two contradictory patterns, and a contributor adding a bootstrap-script rewrite rule has to guess which one to follow.

Outcome

Every file in src/Fallout.Migrate/Steps/ is a migration step, and each step owns the rewrite rules for its own artifact type.

Acceptance criteria

  • ScriptRewriters regex fields and Rewrite method live in RewriteBootstrapScriptsStep
  • src/Fallout.Migrate/Steps/ScriptRewriter.cs is deleted
  • ScriptRewriterSpecs is renamed to RewriteBootstrapScriptsStepSpecs, file and class
  • dotnet test tests/Fallout.Migrate.Specs passes with no test changes beyond the rename
  • No behaviour change

Notes

Good first issue: a mechanical move of about 50 lines with no design decisions. Copy the shape of aef6c073 (Fold CsprojRewriter into RewriteCsprojsStep) — it is the same change on a sibling step. The convention is written up in #574.

Activity

  1. ITaluone commented on Jul 27, 2026

    @ITaluone
    Contributor

    Ou.. that went along too in #577

  2. ChrisonSimtian commented on Jul 27, 2026

    @ChrisonSimtian
    CollaboratorAuthor

    Ou.. that went along too in #577

    nice :-) all yours ;-)

  3. linked a pull request that will close this issueRefactor migration specs #577on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions