The Wayback Machine - https://web.archive.org/web/20250923075208/https://github.com/rubocop/ruby-style-guide/pull/725
Skip to content

Conversation

baweaver
Copy link

Based off of a very old issue that had a lot of interesting discussion:

#359

The idea here is that hanging indentation is incredibly hard to read while going down a page, and also incurs extra editing whenever more methods are added to a chain.

Based off of a very old issue that had a lot of interesting discussion:

rubocop#359

The idea here is that hanging indentation is incredibly hard to read while going down a page, and also incurs extra editing whenever more methods are added to a chain.
```ruby
# bad (hanging indent)
some_method.with.a_longer.chain(:parameter_1,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be made clear with respect to:

  1. no method chain - e.g. some_method(a,
  2. short method chain - frankly it seems to the example you deleted looks fine, as it's not really a long method chain.
end
```
* <a name="no-hanging-indent"></a>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe no-hanging-param-indent or something like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants