GNU bug report logs -
#16182
24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens
Previous Next
Reported by: Dmitry Gutov <dgutov <at> yandex.ru>
Date: Wed, 18 Dec 2013 03:56:02 UTC
Severity: minor
Found in version 24.3.50
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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.
This bug report was last modified 11 years and 247 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.