Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout/ClosingParenthesisIndentation update leads to false indentation in keyword param edge case #5889

Closed
kmoschcau opened this issue May 15, 2018 · 3 comments
Labels
bug stale Issues that haven't been active in a while

Comments

@kmoschcau
Copy link

Hi, this might just be a small edge case and maybe not even desired layout according to the style guide, but if so it should be handled by another cop and not this one.

Initial setup

# Have a method definition with a keyword parameter, where you put the 
# default value on the next line, followed by another keyword and default
# value pair, or a double asterisk.
def foo(
  bar:
    'baz', **
)
end

As I said, this might not be a perfect layout in tune with the style guide, but right now there is nothing I found, that forbids this.

Expected behavior

Rubocop should keep the closing parenthesis at exactly this indent and not complain.
That actually is the case, if you move the double asterisk or key-value-pair to a line on their own.

Actual behavior

Rubocop wants to indent the closing parenthesis one further, on the same column as the "bar" symbol in the example.

Steps to reproduce the problem

See the initial setup.

RuboCop version

$ rubocop -V
0.56.0 (using Parser 2.5.1.0, running on ruby 2.3.5 x86_64-linux)
@Drenmi Drenmi added the bug label Jun 7, 2018
@antonzaytsev
Copy link
Contributor

Can be fixed by #6351

@stale
Copy link

stale bot commented May 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale Issues that haven't been active in a while label May 8, 2019
@stale
Copy link

stale bot commented Jun 7, 2019

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

@stale stale bot closed this as completed Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Issues that haven't been active in a while
Projects
None yet
Development

No branches or pull requests

3 participants