Rubyfmt - 0.1, the one where it doesn't break RSpec
Rubyfmt is a Ruby autoformatter in the style of gofmt. Unlike rubocop, it is intended to only be a formatter, and not any kind of deeper analysis tool.
Rubyfmt is currently "functional" in the sense that it can execute over the entirety of rspec/rspec-core and not break any of the tests.
Rubyfmt currently just outputs valid ruby, and I haven't done much in the way of making it style things in any way that remotely mirrors what makes sense for ruby. As such isn't yet really fit for day to day usage. If you'd like to try it out though, you can check out the section below
Rubyfmt is a standalone script that only loads the standard library of Ruby, as such it is not packaged as a gem. It is intended to be in your editor's save hook and run really fast.
~/binto your PATH (e.g.
echo "$HOME/bin:$PATH" >> ~/.bash_profile)
- Set your editor to run
rubyfmt file_name > file_nameon save.
At this stage things are too early for us to accept PRs that affect output styling.
I will happily accept plugins that make Rubyfmt work with your favourite editor, or improve the CLI usability.
The next thing I'm gonna do is make Rubyfmt self hosting, which will naturally involve me updating how it formats things in a way that I don't hate.