RubyMine code formatting space around exponent

I want spaces around most operators (||, *, <<, etc) but not around exponent (**). For one thing, rubocop expects the former and rejects the latter. Am I missing some way to configure the code formatter to do what I want?

0
6 comments

Could you please specify your RubyMine version and also settings on Settings | Editor | Code Style | Ruby | Spaces?

0

RubyMine 2021.1 Beta
Build #RM-211.6432.10, built on March 10, 2021
RubyMine EAP User
Expiration date: April 9, 2021
Runtime version: 11.0.10+9-b1341.19 x86_64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
macOS 10.14.6
GC: ParNew, ConcurrentMarkSweep
Memory: 8108M
Cores: 12
Non-Bundled Plugins: com.github.redfoos.logstash-intellij-plugin (0.63-EAP), com.intellij.ideolog (203.0.26.0), com.intellij.properties (211.6432.9), com.jetbrains.plugins.ini4idea (211.6432.7), org.jetbrains.plugins.go-template (211.6432.7), org.jetbrains.plugins.hocon (2020.1.0)

0

Could you please provide the code sample where spaces aren't used?

0

If I use the settings as in the picture, it adds space before exponent operator which I don't want

LruRedux::Cache.new(2 ** 19)

If I turn off the "Other operators", it doesn't add those space, but it removes spaces from operators like `||,<<,+` which is wrong

([]<<year.to_s)
if phrase.blank?||phrase.bytesize > KEYWORD_PHRASE_LIMIT
 oldfillers+newfillers 
0

and rubocop rejects the spaces before and after `**` but rejects lack of spaces for the other operators.

0

Thank you for explanations, I've submitted a corresponding request on the tracker so could you please add your vote and follow it there: https://youtrack.jetbrains.com/issue/RUBY-27981

0

Please sign in to leave a comment.