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
> rubocop example.rb --only Style/AlignHash,Style/ExtraSpacing --auto-correct
Inspecting 1 file
C
Offenses:
example.rb:2:3: C: [Corrected] Align the elements of a hash literal if they span more than one line.
'ospfTest' => {
^^^^^^^^^^^^^^^
example.rb:2:13: C: [Corrected] Unnecessary spacing detected.
'ospfTest' => {
^^^
0 files inspected, 2 offenses detected, 2 offenses corrected
gems/rubocop-0.34.2/lib/rubocop/runner.rb:161:in `check_for_infinite_loop': Infinite loop detected in example.rb. (RuboCop::Runner::InfiniteCorrectionLoop)
from gems/rubocop-0.34.2/lib/rubocop/runner.rb:136:in `block in do_inspection_loop'
from gems/rubocop-0.34.2/lib/rubocop/runner.rb:135:in `loop'
from gems/rubocop-0.34.2/lib/rubocop/runner.rb:135:in `do_inspection_loop'
from gems/rubocop-0.34.2/lib/rubocop/runner.rb:87:in `process_file'
from gems/rubocop-0.34.2/lib/rubocop/runner.rb:57:in `block in inspect_files'
from gems/rubocop-0.34.2/lib/rubocop/runner.rb:55:in `each'
from gems/rubocop-0.34.2/lib/rubocop/runner.rb:55:in `inspect_files'
from gems/rubocop-0.34.2/lib/rubocop/runner.rb:33:in `run'
from gems/rubocop-0.34.2/lib/rubocop/cli.rb:26:in `run'
<snip>
> rubocop --version
0.34.2
Reverting to the default settings for Style/AlignHash means this issue is no longer seen.
The text was updated successfully, but these errors were encountered:
My bad. If the ExtraSpacing cop removes spaces anywhere between a key and a value in a hash literal, it can unalign something that was aligned. Will fix.
The current fix for #2121 isn't sufficient when using non-default style settings for Style/AlignHash:
.rubocop.yml
:example.rb
:Reverting to the default settings for Style/AlignHash means this issue is no longer seen.
The text was updated successfully, but these errors were encountered: