Class: SCSSLint::Runner
- Inherits:
-
Object
- Object
- SCSSLint::Runner
- 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
-
#lints ⇒ Object
readonly
Returns the value of attribute lints.
Instance Method Summary collapse
-
#initialize(config) ⇒ Runner
constructor
A new instance of Runner.
- #run(files) ⇒ Object
Constructor Details
#initialize(config) ⇒ Runner
Returns a new instance of Runner.
11 12 13 14 15 |
# File 'lib/scss_lint/runner.rb', line 11 def initialize(config) @config = config @lints = [] @linters = LinterRegistry.linters.map(&:new) end |
Instance Attribute Details
#lints ⇒ Object (readonly)
Returns the value of attribute lints.
8 9 10 |
# File 'lib/scss_lint/runner.rb', line 8 def lints @lints end |
Instance Method Details
#run(files) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/scss_lint/runner.rb', line 18 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 |