Class: SCSSLint::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/scss_lint/runner.rb

Overview

Finds and aggregates all lints found by running the registered linters against a set of SCSS files.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Runner

Returns a new instance of Runner.

Parameters:



8
9
10
11
12
13
# File 'lib/scss_lint/runner.rb', line 8

def initialize(config)
  @config  = config
  @lints   = []
  @linters = LinterRegistry.linters.select { |linter| @config.linter_enabled?(linter) }
  @linters.map!(&:new)
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



5
6
7
# File 'lib/scss_lint/runner.rb', line 5

def files
  @files
end

#lintsObject (readonly)

Returns the value of attribute lints.



5
6
7
# File 'lib/scss_lint/runner.rb', line 5

def lints
  @lints
end

Instance Method Details

#run(files) ⇒ Object

Parameters:

  • files (Array<Hash>)

    list of file object/path hashes



16
17
18
19
20
21
# File 'lib/scss_lint/runner.rb', line 16

def run(files)
  @files = files
  @files.each do |file|
    find_lints(file)
  end
end