rubyfmt – fast opinionated Ruby formatter

rubyfmt is a fast, opinionated formatter for Ruby source code. It is designed to remove routine decisions about source presentation, producing a consistent layout so developers can concentrate on the code rather than spacing, indentation and line wrapping.

Its formatting engine is implemented in Rust. The project deliberately concentrates on automated source formatting rather than combining formatting with a large collection of linting and static-analysis rules. This makes it suited to projects that want a dedicated formatter with predictable behaviour.

This is free and open source software.

Key Features

  • Formats Ruby source with an opinionated, deterministic style.
  • Writes formatted output directly to standard output when given a file.
  • Rewrites files in place for project-wide formatting.
  • Shows a diff of proposed formatting changes without altering the source.
  • Accepts Ruby code through standard input for use in pipelines and editor integrations.
  • Processes directories so multiple Ruby files can be formatted in one operation.
  • Supports header comments that explicitly opt files in to or out of formatting.
  • Uses a .rubyfmtignore file with gitignore-style patterns to exclude selected paths.
  • Respects .gitignore by default, with an option to include ignored files when required.
  • Can be integrated with Ruby LSP through a dedicated formatter add-on.
  • Provides integrations or documented workflows for Vim, Visual Studio Code, RubyMine, Sublime Text and other editors.
  • Can be used alongside RuboCop through the separate rubocop-rubyfmt integration.
  • Includes a Vim plugin in the repository for direct editor use.
  • Offers a command-line interface suitable for both one-off formatting and repeatable project workflows.

Website: github.com/fables-tales/rubyfmt
Support:
Developer: Fable Tales
License: MIT License

rubyfmt is written in Rust. Learn Rust with our recommended free books and free tutorials.


Related Software

Ruby Code Formatters
RuboCopChecks style, detects potential problems, and autocorrects offences
Standard RubyCombines linting and automatic fixes with a shared set of rules
rubyfmtApplies a consistent style with minimal configuration required
Syntax TreeToolkit for parsing, inspecting, and transforming source files
RufoKeeps source files tidy with an opinionated approach to style
alofmtDelivers fast, deterministic formatting for consistent results

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted