RubyMine with Rubocop - How to Reformat?

I have RuboCop installed with Rubymine and the validation errors for rubocop are displayed correctly.

Running ⌘+ Alt+ Lconverts the code into rubimine style that conflicts with rubocop style.

For instance:

some_array = 10.times.map {|index| index * 3}   # rubymine
some_array = 10.times.map { |index| index * 3 } # rubocop

rubocop places spaces inside inline blocks. little thing i know. but ruby ​​auto formats without spaces, so I have a crypton of inspection notifications.

+4
source share
1 answer

In Rubymine, go to "Preferences" β†’ "Editor" β†’ "Code Style" β†’ "Ruby" and make sure that the Places around curly braces box are checked .

enter image description here

+1
source

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


All Articles