You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Layout/ArgumentAlignment set to with_fixed_indentation, I expect that the
first argument will always be indented an additional level from the method call
line. When Layout/FirstMethodArgumentLineBreak, moves a argument to the next
line, I expect this new line to be indented.
Actual behavior
When method calls are nested and Layout/FirstMethodArgumentLineBreak moves the
first argument to a new line, that new line is not indented.
$ bundle exec rubocop --debug -A test.rb
For /home/jon/test: configuration from /home/jon/test/.rubocop.yml
Default configuration from /home/jon/test/.bundle/ruby/3.1.0/gems/rubocop-1.32.0/config/default.yml
Use parallel by default.
Running parallel inspection
Loading cache from /home/jon/.cache/rubocop_cache/e062dc539034f87d925e4c6b7fb6bb1915a56b8e/6d7a3b621ca1730e04accd938619e4bdab66cfb1/fe425179b4f1deedd5a514216b91c8bc6bdcf304
Inspecting 1 file
Scanning /home/jon/test/test.rb
Loading cache from /home/jon/.cache/rubocop_cache/e062dc539034f87d925e4c6b7fb6bb1915a56b8e/6d7a3b621ca1730e04accd938619e4bdab66cfb1/fe425179b4f1deedd5a514216b91c8bc6bdcf304
C
Offenses:
test.rb:4:27: C: [Corrected] Layout/FirstMethodArgumentLineBreak: Add a line break before the first argument of a multi-line method argument list.
expect(my_method).to eq([ ...
^
test.rb:5:5: C: [Corrected] Layout/FirstArrayElementIndentation: Use 2 spaces for indentation in an array, relative to the first position after the preceding left parenthesis.
'a',
^^^
test.rb:6:29: C: [Corrected] Layout/FirstArrayElementIndentation: Use 2 spaces for indentation in an array, relative to the start of the line where the left square bracket is.
'a',
^^^
test.rb:7:5: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
'b',
^^^
test.rb:7:29: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
'b',
^^^
test.rb:8:3: C: [Corrected] Layout/FirstArrayElementIndentation: Indent the right bracket the same as the first position after the preceding left parenthesis.
])
^
test.rb:8:5: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
'c'
^^^
test.rb:8:29: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
'c'
^^^
test.rb:9:27: C: [Corrected] Layout/FirstArrayElementIndentation: Indent the right bracket the same as the start of the line where the left bracket is.
])
^
test.rb:9:28: C: [Corrected] Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.
])
^
1 file inspected, 10 offenses detected, 10 offenses corrected
Finished in 0.245670356991468 seconds
…umentIndentation`
Fixesrubocop#10830.
This PR fixes an incorrect autocorrect for `Layout/FirstArgumentIndentation` when specifying
`EnforcedStyle: with_fixed_indentation` of `Layout/ArgumentAlignment` and
`EnforcedStyle: consistent` of `Layout/FirstArgumentIndentation` and
enabling `Layout/FirstMethodArgumentLineBreak`.
…umentIndentation`
Fixesrubocop#10830.
This PR fixes an incorrect autocorrect for `Layout/FirstArgumentIndentation` when specifying
`EnforcedStyle: with_fixed_indentation` of `Layout/ArgumentAlignment` and
`EnforcedStyle: consistent` of `Layout/FirstArgumentIndentation` and
enabling `Layout/FirstMethodArgumentLineBreak`.
Expected behavior
With Layout/ArgumentAlignment set to with_fixed_indentation, I expect that the
first argument will always be indented an additional level from the method call
line. When Layout/FirstMethodArgumentLineBreak, moves a argument to the next
line, I expect this new line to be indented.
Actual behavior
When method calls are nested and Layout/FirstMethodArgumentLineBreak moves the
first argument to a new line, that new line is not indented.
Steps to reproduce the problem
.rubocop.yml
test.rb
Run RuboCop
result
expected
RuboCop version
The text was updated successfully, but these errors were encountered: