lib/scss_lint/runner.rb in scss_lint-0.41.0 vs lib/scss_lint/runner.rb in scss_lint-0.42.0
- old
+ new
@@ -6,11 +6,12 @@
# @param config [Config]
def initialize(config)
@config = config
@lints = []
- @linters = LinterRegistry.linters.map(&:new)
+ @linters = LinterRegistry.linters.select { |linter| @config.linter_enabled?(linter) }
+ @linters.map!(&:new)
end
# @param files [Array]
def run(files)
@files = files
@@ -42,10 +43,9 @@
@lints << Lint.new(nil, file, Location.new, ex.to_s, :error)
end
# For stubbing in tests.
def run_linter(linter, engine, file)
- return unless @config.linter_enabled?(linter)
return if @config.excluded_file_for_linter?(file, linter)
@lints += linter.run(engine, @config.linter_options(linter))
end
end
end