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.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.