rfmt

Opinionated Ruby code formatter written in Rust

A Ruby formatter that parses with Prism and formats natively in Rust, with Ruby providing only the CLI and a language server: minimal configuration, idempotent output, preserved comments, and editor integration through Ruby LSP.

  • 0.19 ms a fileFormat time, in process

Trade-offs

  • Moving parsing into Rust dropped a Ruby parse and a JSON handoff, cutting in-process time from 4.28 ms to 0.19 ms a file, while a cold CLI call still takes 0.1 to 0.25 s, mostly Ruby VM startup.
  • Opinionated with minimal configuration, so output is consistent across codebases, at the cost of the per-team tuning that RuboCop's style rules allow.

Q&A1

A script formats rfmt's own lib directory in process and reports time per file; the published numbers are from arm64 macOS on Ruby 3.4.

Reviews

Loading reviews

    More in Ruby

    See all 11 →
    • LastSignalSelf-hosted dead man's switch that delivers end-to-end encrypted messages
    • RoundhouseOps UI for Sidekiq and Solid Queue, mounted as a Rails engine
    • DobaseA self-hosted workspace of installable tools, from mail and boards to video
    • RedGem3D game engine and editor where gameplay is written in Ruby
    • yrbyYjs backend for Rails on y-crdt, with no Node process to run
    • Proxmox-GitOpsGitOps automation for Linux containers on Proxmox VE

    More in Developer tools

    See all 88 →
    • EpuppBrowser extension that opens a live ClojureScript REPL into any web page
    • ResonanceA local-first API client with no account, collections kept as YAML files
    • PandiaDesktop JSON editor for multi-gigabyte files, with the document held in Rust
    • PandaWardLocal application security assessment that reports what it couldn't decide
    • ScalexScala code navigation for coding agents, from source and without a build
    • polyOne Rust binary that lints and formats about 30 languages

    More in Rust

    See all 146 →
    • PaganelData migration engine that verifies the destination down to the row
    • FeOxDBEmbedded key-value store in Rust with write-behind durability
    • AudioRouterVisual audio router for Windows 11: route, process and record on a canvas
    • ai-memoryPersistent memory for MCP clients in one Rust binary over SQLite
    • AntirionAI gateway in one Rust binary, with the admin console built in
    • jc-rsjc rewritten as one static binary that turns command output into JSON