简体   繁体   中英

SublimeText 2 Ruby formatting

Has anyone found a good Ruby/Rails formatter? There is BeautifyRuby, but it gets strings written like Q%[] wrong because it aligns everything to the [] and it messes everything up.

Essentially it looks like this from a function auto formatted by beautifyruby:

 %x[#{cat_command} &]
    %x[#{join_command} &]
       return newintroname
       end

Does anyone have an idea how to fix this?

当前版本的beautifyRuby实际上解决了这个问题。

I recommend you to use RuboCop to find all the issues/suggestions/alternatives/good practices in Ruby. It is also available as a Sublime Text plugin.

Ruby Good Practices: https://github.com/bbatsov/ruby-style-guide

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM