Class: RuboCop::Formatter::FileListFormatter Private

Inherits:
BaseFormatter show all
Defined in:
lib/rubocop/formatter/file_list_formatter.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This formatter displays just a list of the files with offenses in them, separated by newlines. The output is machine-parsable.

Here’s the format:

/some/file /some/other/file

Instance Attribute Summary

Attributes inherited from BaseFormatter

#options, #output

Instance Method Summary collapse

Methods inherited from BaseFormatter

#file_started, #finished, #initialize, #started

Constructor Details

This class inherits a constructor from RuboCop::Formatter::BaseFormatter

Instance Method Details

#file_finished(file, offenses) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


13
14
15
16
17
# File 'lib/rubocop/formatter/file_list_formatter.rb', line 13

def file_finished(file, offenses)
  return if offenses.empty?

  output.printf("%<path>s\n", path: file)
end