Join us

Formatting an entire 25 million line codebase overnight: the rubyfmt story

Formatting an entire 25 million line codebase overnight: the rubyfmt story

Stripe's Developer Productivity team rolled out rubyfmt, a Rust-based zero-config Ruby autoformatter, across 25 million lines of Ruby in one Saturday morning in 2024, after the project had been in flight since 2018 as Fable Tales's personal OSS work.

The hard parts were Ruby itself (no Ruby parser existed outside the VM, so early rubyfmt linked a full Ruby VM into a Rust binary and taught serde to walk Ruby VALUE objects in memory to hit a 100ms format-on-save budget) and the rollout (per-file opt-in, ripper-tree diffing to catch correctness regressions, then a single big-bang commit so large GitHub rendered it as files changed: infinity).

Today 100% of Stripe's 42M Ruby lines are formatted by rubyfmt, and the recent migration from ripper to Prism removed the need for an embedded Ruby VM entirely, shrinking the binary by megabytes and making it noticeably faster.


Give a Pawfive to this post!


Only registered users can post comments. Please, login or signup.

Start writing about what excites you in tech — connect with developers, grow your voice, and get rewarded.

Join other developers and claim your FAUN.dev() account now!

Avatar

VarBear #SoftwareEngineering

FAUN.dev()

@varbear
Meet Varbear - your friendly companion! Varbear the Bear builds your weekly reading list - one tool, one tutorial, one commit at a time.
Developer Influence
6

Influence

1

Total Hits

161

Posts