Prettier for ruby
This repo is deprecated
:construction: Work in Progress! :construction:
Please note that this plugin is under active development, and might not be ready to run on production code yet.
Prettier-Ruby relies on Ripper, the official parser of Ruby to understand your code. Once your code has been read and parsed, it is then reformatted using the formatting commands provided by Prettier.
If you're interested in contributing to the development of Prettier for Ruby:
yarnto install dependencies
yarn run test
You will find it useful to read the CONTRIBUTING guide from Prettier, as it all applies to this repository too.
Prettier-Ruby makes use of Ruby's official lexer and parser, Ripper. You can see the output of Ripper's tokens, sexpressions, the intermediate representation that prettier-ruby uses, as well as the final prettier-ruby result by appending
DEBUG=truewhen running tests:
DEBUG=true yarn run test --watch
You should now see some useful debug output in your console:
You can run the Ruby AST Exporter directly with a given string too:
$ ruby vendor/ruby/astexport.rb "puts 'hello world'"
To run an individual test folder:
DEBUG=true yarn run test tests/defs --watch
Until this package is officially released to npm you must clone it yourself, and run it directly:
yarnto install dependencies
yarn prettier test.rbto check the output of a single file
yarn prettier your_folder/**/*.rb
yarn prettier your_folder/**/*.rb --write
Thanks goes to these wonderful people (emoji key):
|
Alan Foster
📖 🐛 💻 🤔 |
Amit Solanki
📖 🐛 💻 🤔 💡 👀 ⚠️ |
| :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the all-contributors specification. Contributions of any kind welcome!