Closed
Description
The autocorrect for Layout/FirstHashElementIndentation
breaks indentation consistency when inspecting this code.
(Code borrowed from grape's README)
desc 'Returns your public timeline.' do
headers XAuthToken: {
description: 'Validates your identity',
required: true
},
XOptionalHeader: {
description: 'Not really needed',
required: false
}
end
Expected behavior
No offenses, or correct the code with keeping indentation consistency for the second hash element.
Actual behavior
C: [Correctable] Layout/FirstHashElementIndentation: Indent the right brace the same as the start of the line where the left brace is.
},
^
The code is autocorrected like,
desc 'Returns your public timeline.' do
headers XAuthToken: {
- description: 'Validates your identity',
- required: true
- },
+ description: 'Validates your identity',
+ required: true
+ },
XOptionalHeader: {
description: 'Not really needed',
required: false
}
Steps to reproduce the problem
Run rubocop against the above code with the default configuration.
RuboCop version
$ exe/rubocop -V
1.30.0 (using Parser 3.1.2.0, rubocop-ast 1.18.0, running on ruby 2.7.5 x86_64-darwin20)
- rubocop-performance 1.14.0
- rubocop-rake 0.6.0
- rubocop-rspec 2.11.1
Metadata
Assignees
Labels
No labels
Activity