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
Possible bug in Layout/FirstHashElementIndentation #10751
Comments
cc @j-miyake |
You're right. That's an unintended behavior since |
8 tasks
j-miyake
added a commit
to j-miyake/rubocop
that referenced
this issue
Jun 28, 2022
…ation Fixes rubocop#10751 `Layout/FirstHashElementIndentation` should allow a hash where the content of the first pair is indented relative to the base column specified with configured cop style, and the second pair begins on the same line with the right brace of the first pair; because those two keys won't be aligned with each other by `Layout/HashAlignment`, not like the case of rubocop#10689. With no parenthesis ```ruby post :create, params: { foo: { bar: 'Baz' } }, as: :json ``` With the parenthesis and `special_inside_parentheses` style ```ruby post(:create, params: { foo: { bar: 'Baz' } }, as: :json) ``` With the parenthesis and `consistent` style ```ruby post(:create, params: { foo: { bar: 'Baz' } }, as: :json) ```
bbatsov
pushed a commit
that referenced
this issue
Jun 29, 2022
Fixes #10751 `Layout/FirstHashElementIndentation` should allow a hash where the content of the first pair is indented relative to the base column specified with configured cop style, and the second pair begins on the same line with the right brace of the first pair; because those two keys won't be aligned with each other by `Layout/HashAlignment`, not like the case of #10689. With no parenthesis ```ruby post :create, params: { foo: { bar: 'Baz' } }, as: :json ``` With the parenthesis and `special_inside_parentheses` style ```ruby post(:create, params: { foo: { bar: 'Baz' } }, as: :json) ``` With the parenthesis and `consistent` style ```ruby post(:create, params: { foo: { bar: 'Baz' } }, as: :json) ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After 023e0ea the behavior of Layout/FirstHashElementIndentation changed for the
consistent
style. Where code like this used to be acceptedit now fails with
Autocorrecting changes the code into
which (at least I thought) isn’t the intended behavior for
consistent
style.RuboCop version
The text was updated successfully, but these errors were encountered: