--- Begin Message ---
Subject: |
24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens |
Date: |
Wed, 18 Dec 2013 05:55:19 +0200 |
Judging by the open source code, it's not overly popular, but there's a
definite tendency to align literals in these kind of examples to the
beginning of the statement, not to the opening paren that contains them
(which is what ruby-mode does now, as long as there is any text after
the opening round paren):
https://github.com/intridea/grape/blob/master/README.md#basic-usage
Status.create!({
user: current_user,
text: params[:status]
})
https://github.com/intridea/grape/blob/master/lib/grape/endpoint.rb#L79
methods.each do |method|
route_set.add_route(self, {
path_info: route.route_compiled,
request_method: method,
}, route_info: route)
end
The code is the trunk indents the second example like this:
methods.each do |method|
route_set.add_route(self, {
path_info: route.route_compiled,
request_method: method,
}, route_info: route)
end
Which is the preferred style? Should ruby-mode support both?
The former style looks more compact, but it can also make the arguments
following the "de-indented" literal look a bit out of place.
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#16182: Acknowledgement (24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens) |
Date: |
Sun, 22 Dec 2013 04:01:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
On 21.12.2013 21:32, Adam Doppelt wrote:
I think 'ruby-align-to-stmt-keywords' is a perfectly fine name, btw.
Ah, okay then. Without an overwhelming support for a rename, the current
name stays.
Thanks everyone, I'm closing this bug now. It has veered off to the
side, but for now the answer to the original question is no, with only
one vote in favor. Let's maybe revisit it again sometime.
--- End Message ---