forked from rubocop/rubocop
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix rubocop#10751] Fix autocorrect for Layout/FirstHashElementIndent…
…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) ```
- Loading branch information
Showing
4 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelog/fix_autocorrect_for_first_hash_element_indentation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#10751](https://github.com/rubocop/rubocop/issues/10751): Fix autocorrect for Layout/FirstHashElementIndentation. ([@j-miyake][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters