So today I was (happily) able to announce that the Rubyfmt unit suite is working in the Rust backend. This is a huge milestone for the library, but I also wanted to take a little time to talk about what’s next.
Implement a few remaining syntax nodes
The Rubyfmt unit suite is designed to be a comprehensive set of programs that show a minimal use of every possible node
in Ruby’s grammar. I definitely missed a few while building out the first implementation, and this is evidenced quickly
while running on larger programs. I’ll be working through filling those gaps as the next priority. I’m also intending to
remove one very large program (
rspec_core_notifications_actual copied directly from RSpec’s source code). I’ll be
replacing that with a full execution over the RSpec source code
Right now the Rubyfmt architecture is designed to walk a Ripper syntax tree and produce a queue of tokens. Those tokens have a “naieve” stringification. This naieve stringification prints very ugly Ruby programs. The pure Ruby architecture features a backend called “fixup” which introspects groups of those tokens to actually nice syntax. I need to implement that before anyone can get their hands on it.
Proper integration between the Ruby program and the Rust library
What I have right now is a total hack to just make something work. In order to be release worthy we need a story around
Rubyfmt rust library and the Ruby shell.
CI / builds / QA
Right now the CI for rubyfmt is totally busted, and based on a beta of GitHub actions. I’ll be moving that to a more modern version of GitHub actions and doing things like automating rust compilation and clippy checks.
First things first
My first milestone will be the same as the pure Ruby version of Rubyfmt. Getting the RSpec Core test suite passing against formatted files. Once that’s done, we then move on to ensuring the formatted code looks good in most scenarios, and aim towards our next release.
You shouldn’t expect that any time right soon, as there’s plenty of work still to do. I appreciate, however, you following along for the journey. As always, day to day updates can be found on my twitter: @penelope_zone