Auto-formatting empty methods?

Answered

I have empty methods in my Rails controllers:


  def index; end

  def new; end

  def edit; end




I would like the auto-formatter to format/preserve empty methods on a single line as shown above.  But right now, it breaks the definition into multiple lines:



  def index;
  end

  def new;
  end

  def edit;
  end




How can tell RubyMine to do this?

Thanks.
2 comments
Comment actions Permalink

I was looking for the same feature. Auto-formatting should support the rules that follow the "standard" format that RubyMine/Ruby Plugin suggest to use at default.

 

> One exception to the rule are empty-body methods.

https://github.com/rubocop-hq/ruby-style-guide

# good
def no_op; end

 

0
Comment actions Permalink

Hello,

we have a corresponding request on our tracker so please add your vote:

https://youtrack.jetbrains.com/issue/RUBY-20204

0

Please sign in to leave a comment.