Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

rubyfmt formats Ruby code according to a consistent, opinionated style. The project describes it as fast and implements it in Rust; its README documents installation with Homebrew or a Cargo source build, command-line formatting options, ignore controls, and setup guidance for several editors.

What rubyfmt does

rubyfmt is an open-source Ruby formatter written in Rust. It applies its own formatting rules rather than presenting itself as a highly configurable style framework. The project calls it “fast,” but the available project documentation does not provide an independent, reproducible benchmark that quantifies that claim.

Developers have discussed whether to add rubyfmt as a Ruby LSP formatter option; a historical Ruby LSP issue records that question, not a current consensus or a measure of adoption.

Install rubyfmt

Homebrew

The project README recommends Homebrew for a quick start:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
brew install rubyfmt

The Homebrew formula lists version 0.14.1 and platform bottles for the macOS and Linux targets shown on its page. Package versions and bottle availability can change, so consult the formula for the current details.

Build from source with Cargo

If you have Cargo installed, the project documents building a release binary and placing it on your PATH under the command name rubyfmt:

cargo build --release
cp target/release/rubyfmt-main /path/on/your/PATH/rubyfmt

Replace /path/on/your/PATH with a directory on your PATH. After installation, check that rubyfmt runs from your shell.

Format Ruby files from the command line

Run the command with a file to print formatted code to standard output, or add -i to rewrite the file in place:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
rubyfmt myfile.rb
rubyfmt -i myfile.rb

To review the proposed changes as a diff instead of rewriting the file, use -c:

rubyfmt -c myfile.rb

The README also documents standard input and directories. Piping a file sends its contents to rubyfmt, while passing a directory lets the formatter process multiple files:

cat myfile.rb | rubyfmt
rubyfmt path/to/directory

Control which files rubyfmt processes

By default, rubyfmt respects patterns in .gitignore. To set additional exclusions, put a .rubyfmtignore file in the project root; it uses .gitignore syntax. Use --include-gitignored when you want to include files otherwise excluded by Git’s ignore rules.

The project also documents header opt-in and opt-out controls for individual files when the corresponding header option is enabled. These controls let a project or invocation select files without changing the formatter’s general file-discovery behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use rubyfmt in an editor

Ruby LSP and VS Code

The project documents a Ruby LSP add-on for using rubyfmt as a formatter. Add it to a development group with Bundler:

bundle add ruby-lsp-rubyfmt-formatter --group development

For VS Code, the README shows configuring the Ruby LSP extension as the Ruby formatter and enabling format on save. The relevant settings are:

{
  "[ruby]": {
    "editor.defaultFormatter": "Shopify.ruby-lsp",
    "editor.formatOnSave": true
  },
  "rubyLsp.formatter": "rubyfmt"
}

The RubyGems listing reports version 0.1.2, published March 30, 2026; check the registry for the current version before installing or documenting a specific release.

Other documented editor integrations

The README also provides integration or setup guidance for Neovim, Vim, RubyMine and other JetBrains IDEs, Sublime Text, and Atom. Follow the project’s editor-specific instructions for the editor and version you use; the integration mechanisms differ, so one configuration should not be assumed to apply to all of them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the project says about maintenance

The project README says: “The original author (fables-tales) is no longer working on open source in their spare time. Other contributors work regularly on rubyfmt, and contributors with commit access are welcome to merge changes that pass CI.” This is the project’s own description of contributor activity and its merge process; it does not independently establish a release cadence or a support guarantee.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.