What tools are available for automatically formatting Ruby / Rails code

I am currently using GEdit with several plugins for developing Ruby on Rails. One thing I would like to have is a way to automatically format the source files (.rb,. *. Erb, etc.). Ideally, this would be something that I could invoke from the command line and / or GEdit.

The command line tool would be nice, because I can configure Git binding to automatically format on commit.

What are my options? What are the pros and cons of each?

+3
source share
3 answers

rubocop?

rubocop -a

+2

Not quite the answer to your question, but I'm quite happy with the RubyMine code format.

+1
source

Source: https://habr.com/ru/post/1767629/


All Articles