We use rubocop in our project and it enforces us to align our chain method calls. I used to use RubyMine linter, but it places methods with indent of 2 spaces from beginning of variable.
I tried to find this setting in Preferences > Editor > Code Style > Ruby, but seems they don't have this option for Ruby.
JavaScript has this under Preferences > Editor > Code Style > JavaScript > Wrapping and Braces > Chained method calls > Align when multiline
# bad
variable.m1
.m2
.m3
# good
variable.m1
.m2
.m3
Do we have this option in RubyMine? Or how can we add some custom .editorconfig setting for this? Or maybe there are other options?
Starting with 2019.3, RubyMine has an option for aligning chained method calls by the initial receiver or leading dots for the Ruby language. You can configure it in the same way as for JavaScript: open the Settings/Preferences | Editor | Code Style | Ruby | Wrapping and Braces page and go to the Chained method calls | Alignment option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With