Ameba::Formatter::BaseFormatter - ameba 1.7.0

# class Ameba::Formatter::BaseFormatter

- Ameba::Formatter::BaseFormatter
- Reference
- Object

##
Overview

A base formatter for all formatters. It uses `#output` IO to report results and also implements stub methods for callbacks in `Ameba::Runner#run` method.

##
Direct Known Subclasses

- Ameba::Formatter::DisabledFormatter
- Ameba::Formatter::DotFormatter
- Ameba::Formatter::FlycheckFormatter
- Ameba::Formatter::GitHubActionsFormatter
- Ameba::Formatter::JSONFormatter

##
Defined in:

ameba/formatter/base_formatter.cr

##
Constructors

- .new(output : IO = STDOUT)

##
Instance Method Summary

- #config : Hash(Symbol, Bool | String)
- #finished(sources) : Nil

  Callback that indicates when inspection is finished.

- #output : IO::FileDescriptor | IO::Memory

  TODO allow other IOs

- #source_finished(source : Source) : Nil

  Callback that indicates when source inspection is finished.

- #source_started(source : Source) : Nil

  Callback that indicates when source inspection is started.

- #started(sources) : Nil

  Callback that indicates when inspecting is started.

##
Constructor Detail

def self.new(output : IO = STDOUT) #

##
Instance Method Detail

def config : Hash(Symbol, Bool | String) #
def finished(sources) : Nil #

Callback that indicates when inspection is finished. A list of inspected sources is passed as an argument.

def output : IO::FileDescriptor | IO::Memory #

TODO allow other IOs

def source_finished(source : Source) : Nil #

Callback that indicates when source inspection is finished. A corresponding source is passed as an argument.

WARNING This method needs to be MT safe

def source_started(source : Source) : Nil #

Callback that indicates when source inspection is started. A corresponding source is passed as an argument.

WARNING This method needs to be MT safe

def started(sources) : Nil #

Callback that indicates when inspecting is started. A list of sources to inspect is passed as an argument.