Class: HamlLint::Reporter Abstract
- Inherits:
-
Object
- Object
- HamlLint::Reporter
- Includes:
- Hooks
- Defined in:
- lib/haml_lint/reporter.rb,
lib/haml_lint/reporter/hooks.rb,
lib/haml_lint/reporter/utils.rb
Overview
Abstract lint reporter. Subclass and override #display_report to implement a custom lint reporter.
Direct Known Subclasses
CheckstyleReporter, DefaultReporter, HashReporter, ProgressReporter
Defined Under Namespace
Modules: Hooks, Utils Classes: CheckstyleReporter, DefaultReporter, HashReporter, JsonReporter, ProgressReporter
Class Method Summary collapse
-
.descendants ⇒ Array<Class>
Keep tracking all the descendants of this class for the list of available reporters.
-
.inherited(descendant) ⇒ Object
Executed when this class is subclassed.
Instance Method Summary collapse
-
#display_report(report) ⇒ Object
Implemented by subclasses to display lints from a Report.
-
#initialize(logger) ⇒ Reporter
constructor
Creates the reporter that will display the given report.
Methods included from Hooks
#added_lint, #finished_file, #start
Constructor Details
#initialize(logger) ⇒ Reporter
Creates the reporter that will display the given report.
14 15 16 |
# File 'lib/haml_lint/reporter.rb', line 14 def initialize(logger) @log = logger end |
Class Method Details
.descendants ⇒ Array<Class>
Keep tracking all the descendants of this class for the list of available reporters.
30 31 32 |
# File 'lib/haml_lint/reporter.rb', line 30 def self.descendants @descendants ||= [] end |
.inherited(descendant) ⇒ Object
Executed when this class is subclassed.
37 38 39 |
# File 'lib/haml_lint/reporter.rb', line 37 def self.inherited(descendant) descendants << descendant end |
Instance Method Details
#display_report(report) ⇒ Object
Implemented by subclasses to display lints from a HamlLint::Report.
21 22 23 24 |
# File 'lib/haml_lint/reporter.rb', line 21 def display_report(report) raise NotImplementedError, "Implement `display_report` to display #{report}" end |