lib/scss_lint/runner.rb in scss-lint-0.6 vs lib/scss_lint/runner.rb in scss-lint-0.6.5
- old
+ new
@@ -14,26 +14,32 @@
ignored_linters = LinterRegistry.
extract_linters_from(options.fetch(:ignored_linters, []))
@linters = LinterRegistry.linters.reject do |linter|
ignored_linters.include?(linter)
+ end.map do |linter_class|
+ linter_class.new
end
end
def run(files = [])
raise NoFilesError.new('No SCSS files specified') if files.empty?
raise NoLintersError.new('No linters specified') if linters.empty?
files.each do |file|
find_lints(file)
end
+
+ linters.each do |linter|
+ @lints += linter.lints
+ end
end
def find_lints(file)
engine = Engine.new(file)
linters.each do |linter|
- @lints += linter.run(engine)
+ linter.run(engine)
end
rescue Sass::SyntaxError => ex
@lints << Lint.new(ex.sass_filename, ex.sass_line, ex.to_s)
end