class SlimLint::Reporter
Abstract lint reporter. Subclass and override {#display_report} to implement a custom lint reporter.
@abstract
Attributes
log[R]
@return [SlimLint::Logger] logger to send output to
Public Class Methods
descendants()
click to toggle source
Keep tracking all the descendants of this class for the list of available reporters.
@return [Array<Class>]
# File lib/slim_lint/reporter.rb, line 28 def self.descendants @descendants ||= [] end
inherited(descendant)
click to toggle source
Executed when this class is subclassed.
@param descendant [Class]
# File lib/slim_lint/reporter.rb, line 35 def self.inherited(descendant) descendants << descendant end
new(logger)
click to toggle source
Creates the reporter that will display the given report.
@param logger [SlimLint::Logger]
# File lib/slim_lint/reporter.rb, line 12 def initialize(logger) @log = logger end
Public Instance Methods
display_report(report)
click to toggle source
Implemented by subclasses to display lints from a {SlimLint::Report}.
@param report [SlimLint::Report]
# File lib/slim_lint/reporter.rb, line 19 def display_report(report) raise NotImplementedError, "Implement `display_report` to display #{report}" end