Project

General

Profile

Bug #5357

Indentation of nested operators should nest

Added by Nikolai Weibull about 5 years ago. Updated almost 4 years ago.

Status:
Assigned
Priority:
Normal
[ruby-core:39684]

Description

Hi!

Currently,

return if
hash.
values_at(:a, :b, :c).
reject{ |e| e.nil? or e.empty? }.
empty?

is indented

as

return if
hash.
values_at(:a, :b, :c).
reject{ |e| e.nil? or e.empty? }.
empty?

I would prefer it to be indented as in the first example.


Related issues

Related to Ruby trunk - Feature #6823: Where/how should ruby-mode issues be reported? Assigned

History

#1 [ruby-core:43186] Updated by Koichi Sasada over 4 years ago

  • Category set to misc
  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

#2 [ruby-core:50496] Updated by Nobuyoshi Nakada about 4 years ago

  • Status changed from Assigned to Feedback

=begin
Your first example seems inconsistent, why are the last 3 lines indented at the same column?
It would be:

return if
hash.
values_at(:a, :b, :c).
reject{ |e| e.nil? or e.empty? }.
empty?

But it doesn't look nice to me.

=end

#3 [ruby-core:50519] Updated by Alex Young about 4 years ago

On 03/12/12 02:35, nobu (Nobuyoshi Nakada) wrote:

Issue #5357 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Assigned to Feedback

=begin
Your first example seems inconsistent, why are the last 3 lines indented at the same column?
It would be:

return if
hash.
values_at(:a, :b, :c).
reject{ |e| e.nil? or e.empty? }.
empty?

But it doesn't look nice to me.

Indenting the last 3 lines highlights that the method chain is hanging
off hash. I do this myself.

--
Alex

#4 [ruby-core:51680] Updated by Eric Hodel almost 4 years ago

  • Status changed from Feedback to Assigned
  • Target version set to next minor

Also available in: Atom PDF