Class: HamlLint::Report

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

Overview

Contains information about all lints detected during a scan.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lints, files) ⇒ Report

Creates a report.

Parameters:

  • lints (Array<HamlLint::Lint>)

    lints that were found

  • files (Array<String>)

    files that were linted



14
15
16
17
# File 'lib/haml_lint/report.rb', line 14

def initialize(lints, files)
  @lints = lints.sort_by { |l| [l.filename, l.line] }
  @files = files
end

Instance Attribute Details

#filesObject (readonly)

List of files that were linted.



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

def files
  @files
end

#lintsObject

List of lints that were found.



5
6
7
# File 'lib/haml_lint/report.rb', line 5

def lints
  @lints
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


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

def failed?
  @lints.any?
end