Class: SlimLint::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/slim_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<SlimLint::Lint>)

    lints that were found

  • files (Array<String>)

    files that were linted



16
17
18
19
# File 'lib/slim_lint/report.rb', line 16

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.



10
11
12
# File 'lib/slim_lint/report.rb', line 10

def files
  @files
end

#lintsObject

List of lints that were found.



7
8
9
# File 'lib/slim_lint/report.rb', line 7

def lints
  @lints
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/slim_lint/report.rb', line 21

def failed?
  @lints.any?
end