lib/scss_lint/runner.rb in scss-lint-0.30.0 vs lib/scss_lint/runner.rb in scss-lint-0.31.0
- old
+ new
@@ -33,15 +33,12 @@
engine = Engine.new(file)
config = @config.preferred ? @config : Config.for_file(file)
config ||= @config
@linters.each do |linter|
- next unless config.linter_enabled?(linter)
- next if config.excluded_file_for_linter?(file, linter)
-
begin
- run_linter(linter, engine, config)
+ run_linter(linter, engine, config, file)
rescue => error
raise SCSSLint::Exceptions::LinterError,
"#{linter.class} raised unexpected error linting file #{file}: " \
"'#{error.message}'",
error.backtrace
@@ -53,10 +50,12 @@
rescue FileEncodingError => ex
@lints << Lint.new(nil, file, Location.new, ex.to_s, :error)
end
# For stubbing in tests.
- def run_linter(linter, engine, config)
+ def run_linter(linter, engine, config, file)
+ return unless config.linter_enabled?(linter)
+ return if config.excluded_file_for_linter?(file, linter)
linter.run(engine, config.linter_options(linter))
end
end
end