An opinionated Ruby code formatter that enforces a consistent style with minimal configuration.
Rufo is an opinionated Ruby formatter designed for command-line use and editor integration to automatically format Ruby code on save or demand. It aims to establish a standardized 'one true format' for Ruby, similar to tools like gofmt and Prettier, to reduce style debates and enforce consistency with minimal configuration. It uses Ruby's Ripper parser and lexer for fast performance and preserves intentional code alignment by default.
Ruby developers and teams seeking an automated, low-configuration code formatter to enforce consistent style across projects, particularly those integrating format-on-save in editors like Atom, Emacs, Sublime Text, Vim, or VS Code.
Developers choose Rufo for its zero-config approach that enforces a unified Ruby code style without the complexity of extensive configuration, its fast performance due to using Ruby's built-in Ripper parser, and its unobtrusive default behavior that preserves intentional alignment choices while still formatting poorly aligned code.
The Ruby Formatter
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Rufo enforces a unified Ruby code style with almost no setup, reducing style debates and ensuring consistency across projects, as emphasized in its 'one true format' philosophy.
Built on Ruby's Ripper parser and lexer written in C, Rufo formats code quickly without external dependencies, making it efficient for large codebases.
Preserves intentional code alignment and spacing by default, avoiding disruptive changes to carefully formatted code, as shown in examples like aligned method calls and arrays.
Supports major editors like VS Code, Vim, and Sublime Text with plugins for format-on-save functionality, enhancing developer workflow and adoption.
Includes a --check flag to verify formatting without changes, useful for CI pipelines to enforce code style automatically, with clear exit codes for integration.
Offers minimal configuration options via a .rufo file, which can be restrictive for teams with specific formatting preferences not aligned with Rufo's opinionated defaults.
Only supports Ruby 3.0.0 and above, making it incompatible with legacy projects or older codebases, which excludes a segment of the Ruby community.
Some editor plugins, such as for Atom and Emacs, are marked as under construction in the README, leading to potential integration issues or lack of maintenance.
Unlike RuboCop, Rufo does not provide linting or broader style enforcement, requiring additional tools for comprehensive code quality checks, which adds complexity.