class RuboCop::Runner::InfiniteCorrectionLoop
An exception indicating that the inspection loop got stuck correcting offenses back and forth.
Attributes
offenses[R]
Public Class Methods
new(path, offenses_by_iteration, loop_start: -1)
click to toggle source
Calls superclass method
# File lib/rubocop/runner.rb, line 14 def initialize(path, offenses_by_iteration, loop_start: -1) @offenses = offenses_by_iteration.flatten.uniq root_cause = offenses_by_iteration[loop_start..] .map { |x| x.map(&:cop_name).uniq.join(', ') } .join(' -> ') message = 'Infinite loop detected' message += " in #{path}" if path message += " and caused by #{root_cause}" if root_cause super message end