Class: HamlLint::Reporter Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/haml_lint/reporter.rb

Overview

This class is abstract.

Abstract lint reporter. Subclass and override #report_lints to implement a custom lint reporter.

Direct Known Subclasses

DefaultReporter, JsonReporter

Defined Under Namespace

Classes: DefaultReporter, JsonReporter

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger, report) ⇒ Reporter


12
13
14
15
16
# File 'lib/haml_lint/reporter.rb', line 12

def initialize(logger, report)
  @log = logger
  @lints = report.lints
  @files = report.files
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files


8
9
10
# File 'lib/haml_lint/reporter.rb', line 8

def files
  @files
end

#lintsObject (readonly)

Returns the value of attribute lints


7
8
9
# File 'lib/haml_lint/reporter.rb', line 7

def lints
  @lints
end

Class Method Details

.descendantsObject

Keep tracking all the descendants of this class for the list of available reporters


24
25
26
# File 'lib/haml_lint/reporter.rb', line 24

def self.descendants
  @descendants ||= []
end

.inherited(descendant) ⇒ Object


28
29
30
# File 'lib/haml_lint/reporter.rb', line 28

def self.inherited(descendant)
  descendants << descendant
end

Instance Method Details

#report_lintsObject

Implemented by subclasses to display lints from a HamlLint::Report.

Raises:

  • (NotImplementedError)

19
20
21
# File 'lib/haml_lint/reporter.rb', line 19

def report_lints
  raise NotImplementedError
end