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
Auto-correcting a file containing a heredoc with incorrect indentation, that has a line within consisting only of spaces, leads to an infinite loop.
# frozen_string_literal: truedefm<<~RUBY a the_line_above_has_2_spaces RUBYend
Expected behavior
$ rubocop -a
Inspecting 1 file
C
Offenses:
file.rb:5:1: C: [Corrected] Layout/HeredocIndentation: Use 2 spaces for indentation in a heredoc.
a ...
^^^^^^^^^
1 file inspected, 1 offense detected, 1 offense corrected
Actual behavior
$ rubocop -a
Inspecting 1 file
C
Offenses:
file.rb:5:1: C: [Corrected] Layout/HeredocIndentation: Use 2 spaces for indentation in a heredoc.
a ...
^^^^^^^^^
0 files inspected, 1 offense detected, 1 offense corrected
Infinite loop detected in /home/jonas/dev/8108/file.rb.
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:276:in `block in iterate_until_no_changes'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:272:in `loop'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:272:in `iterate_until_no_changes'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:243:in `do_inspection_loop'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:122:in `block in file_offenses'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:146:in `file_offense_cache'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:120:in `file_offenses'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:111:in `process_file'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:90:in `block in each_inspected_file'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:89:in `each'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:89:in `reduce'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:89:in `each_inspected_file'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:78:in `inspect_files'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/runner.rb:39:in `run'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/cli/command/execute_runner.rb:21:in `execute_runner'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/cli/command/execute_runner.rb:13:in `run'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/cli/command.rb:10:in `run'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/cli/environment.rb:17:in `run'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/cli.rb:65:in `run_command'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/cli.rb:72:in `execute_runners'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/lib/rubocop/cli.rb:41:in `run'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/exe/rubocop:13:in `block in <top (required)>'
/usr/local/rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
/usr/local/rvm/gems/ruby-2.6.5/gems/rubocop-0.85.0/exe/rubocop:12:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.6.5/bin/rubocop:23:in `load'
/usr/local/rvm/gems/ruby-2.6.5/bin/rubocop:23:in `<main>'
/usr/local/rvm/gems/ruby-2.6.5/bin/ruby_executable_hooks:24:in `eval'
/usr/local/rvm/gems/ruby-2.6.5/bin/ruby_executable_hooks:24:in `<main>'
Steps to reproduce the problem
Run rubocop -a on the example file above.
RuboCop version
Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:
Auto-correcting a file containing a heredoc with incorrect indentation, that has a line within consisting only of spaces, leads to an infinite loop.
Expected behavior
Actual behavior
Steps to reproduce the problem
Run
rubocop -a
on the example file above.RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:The text was updated successfully, but these errors were encountered: