lib/scss_lint/cli.rb in scss_lint-0.40.1 vs lib/scss_lint/cli.rb in scss_lint-0.41.0
- old
+ new
@@ -54,11 +54,11 @@
end
def scan_for_lints(options, config)
runner = Runner.new(config)
runner.run(FileFinder.new(config).find(options[:files]))
- report_lints(options, runner.lints)
+ report_lints(options, runner.lints, runner.files)
if runner.lints.any?(&:error?)
halt :error
elsif runner.lints.any?
halt :warning
@@ -157,13 +157,14 @@
config
end
# @param options [Hash]
# @param lints [Array<Lint>]
- def report_lints(options, lints)
+ # @param files [Array<String>]
+ def report_lints(options, lints, files)
sorted_lints = lints.sort_by { |l| [l.filename, l.location] }
options.fetch(:reporters).each do |reporter, output|
- results = reporter.new(sorted_lints).report_lints
+ results = reporter.new(sorted_lints, files).report_lints
io = (output == :stdout ? $stdout : File.new(output, 'w+'))
io.print results if results
end
end