|
From: | Bozhidar Batsov |
Subject: | bug#16182: Acknowledgement (24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens) |
Date: | Thu, 19 Dec 2013 22:33:44 +0200 |
On 19.12.2013 14:54, Bozhidar Batsov wrote:I can confirm that your method args indentation fix is working. I did,however, notice the following problem after I mentioned theif/unless/case with assignment indentation. Consider the following:res = method do |x, y|somethingendMight make sense to indent those like:res = method do |x, y|somethingendfor consistency with the if/unless/case indentation by default.It might be more consistent, but I don't see any projects doing that.For example, ActiveRecord, Grape, Goliath and Rack don't.Check out the examples at the top:It can be an option, though.
---Come to think of it, do you see the "align end to the keyword" stylemuch? I did a grep on my gems directory, and the other style seems to beprevalent, especially among the non-core gems:Pry, RDoc, Minitest, Rubygems, EventMachine, Nokogiri align to keyword.ActiveRecord, ActiveSupport, other Active* gems, Cucumber, Thor, Grape,Excon, WebMock, Faraday align to the beginning of the statement.RSpec uses both. Yard aligns to keyword after "=", but to statementafter "||=".Maybe we even should align to the statement by default, because, youknow, Rails.
Also:res =method do |x, y|somethingendis actually indented like this:res =method do |x, y|somethingendGuess we can special-case this.
[Prev in Thread] | Current Thread | [Next in Thread] |