GNU bug report logs -
#16996
24.3.50; [ruby-mode] Incorrect indentation for implicit hash arguments
Previous Next
Full log
Message #16 received at 16996 <at> debbugs.gnu.org (full text, mbox):
On 29.05.2021 11:55, Lars Ingebrigtsen wrote:
> The current indentation in Ruby here seems pretty natural to me, so I'm
> closing this bug report.
We should probably reopen it. It's not very urgent (as the bug creation
date will confirm), but I wanted to get around to this someday.
Bozhidar, could you confirm it's still needed (or good to have)?
I wanted to find some style guide or other solid description of this
style, but haven't managed to.
Ruby Style Guide strategically avoids this example, and
https://www.rubydoc.info/gems/rubocop/0.83.0/RuboCop/Cop/Layout/HashAlignment
and
https://www.rubydoc.info/gems/rubocop/0.83.0/RuboCop/Cop/Layout/ArgumentAlignment
do that too.
Despite that, I actually have to deal with this implicit recommendation
on a regular basis at work, because when both cops are enabled, Rubocop
will frown on
top(1, :a => 1,
:b => 2
and
top 1, a: 1,
b: 2
I do remember style like
top(1, :a => 1,
:b => 2)
being popular back in the day, but AFAICT a lot of editors now (like
Atom and VS Code) don't support it either.
This bug report was last modified 3 years and 332 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.