Auto-formatting empty methods?

已回答

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.
3
Avatar
Permanently deleted user

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

Hello,

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

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

0

请先登录再写评论。