class RuboCop::Runner::InfiniteCorrectionLoop
offenses back and forth.
An exception indicating that the inspection loop got stuck correcting
rubocop:disable Metrics/ClassLength
formatters and letting cops inspect the files.
This class handles the processing of files, which includes dealing with
def initialize(path, offenses_by_iteration, loop_start: -1)
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