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:



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

def initialize(config)
  @config  = config
  @lints   = []
  @linters = LinterRegistry.linters.map(&:new)
end

Instance Attribute Details

#lintsObject (readonly)

Returns the value of attribute lints.



7
8
9
# File 'lib/scss_lint/runner.rb', line 7

def lints
  @lints
end

Instance Method Details

#run(files) ⇒ Object

Parameters:

  • files (Array)

Raises:



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/scss_lint/runner.rb', line 17

def run(files)
  raise NoFilesError, 'No SCSS files specified' if files.empty?

  files.each do |file|
    find_lints(file)
  end

  @linters.each do |linter|
    @lints += linter.lints
  end
end