class RuboCop::Formatter::BaseFormatter


* ‘#finished`
* `#file_finished`
* `#file_started`
* `#file_finished`
* `#file_started`
* `#started`
* `#initialize`
the invocation order should be like this:
For example, when RuboCop inspects 2 files,
## Method Invocation Order
explicitly, or absolute path.
you need to specify the path as relative path prefixed with `./`
If your custom formatter file is not in `$LOAD_PATH`,
`Kernel.require`.
Note: The path passed to `–require` is directly passed to
rubocop –require ./path/to/my_custom_formatter –format MyCustomFormatter
`./path/to/my_custom_formatter.rb`, you would type this command:
For example, when you have defined `MyCustomFormatter` in
`–format` and `–require` option.
You can tell RuboCop to use your custom formatter with a combination of
## Using Custom Formatter in Command Line
or by implementing all the methods by duck typing.
`RuboCop::Formatter::BaseFormatter` and overriding some methods,
You can create a custom formatter by subclassing
## Creating Custom Formatter
Abstract base class for formatter, implements all public API methods.

def file_finished(file, offenses)

Other tags:
    See: RuboCop::Cop::Offense -

Returns:
  • (void) -

Parameters:
  • offenses (Array(RuboCop::Cop::Offense)) --
  • file (String) --

Other tags:
    Api: - public
def file_finished(file, offenses)
end

def file_started(file, options)

Returns:
  • (void) -

Parameters:
  • options (Hash) --
  • file (String) --

Other tags:
    Api: - public
def file_started(file, options)
end

def finished(inspected_files)

Returns:
  • (void) -

Parameters:
  • inspected_files (Array(String)) --

Other tags:
    Api: - public
def finished(inspected_files)
end

def initialize(output)

Parameters:
  • output (IO) --

Other tags:
    Api: - public
def initialize(output)
  @output = output
end

def started(target_files)

Returns:
  • (void) -

Parameters:
  • target_files (Array(String)) --

Other tags:
    Api: - public
def started(target_files)
end