And attempting to fix it with ruby-lsp (rubocop) yields:
LSP[ruby_lsp] Formatting error: Infinite loop detected in ./prism_bug.rb and caused by Layout/ExtraSpacing, Layout/SpaceAroundMethodCallOperator
Hint: Please update to the latest RuboCop version if not already in use, and report a bug if the issue still occurs on this version.
Using bundle exec rubocop -a prism_bug.rb results in a step-by-step breakdown of the states:
prism_bug.rb:4:23: C: [Corrected] Layout/ExtraSpacing: Unnecessary spacing detected.
"content" => <<~XML. strip,
^^^
prism_bug.rb:4:23: C: [Corrected] Layout/HeredocIndentation: Use 2 spaces for indentation in a heredoc.
"content" => <<~XML.strip, ...
^^^^^^
prism_bug.rb:4:23: C: [Corrected] Layout/SpaceAroundMethodCallOperator: Avoid using spaces around a method call operator.
"content" => <<~XML. strip,
^^^^
0 files inspected, 3 offenses detected, 3 offenses corrected
Infinite loop detected in .prism_bug.rb and caused by Layout/ExtraSpacing, Layout/SpaceAroundMethodCallOperator
Hint: Please update to the latest RuboCop version if not already in use, and report a bug if the issue still occurs on this version.
Please check the latest version at https://rubygems.org/gems/rubocop.
Prism version:
v0.29.0
Rubocop version:1.64.0
With this file:
This error is flagged:
And attempting to fix it with ruby-lsp (rubocop) yields:
Using
bundle exec rubocop -a prism_bug.rb
results in a step-by-step breakdown of the states: