Skip to content

Commit

Permalink
Put stdin_file_path name into files for report
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Matveyev committed May 8, 2021
1 parent 4f49f3a commit 7caf453
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions lib/slim_lint/runner.rb
Expand Up @@ -15,18 +15,17 @@ class Runner
# @return [SlimLint::Report] a summary of all lints found
def run(options = {})
config = load_applicable_config(options)
files = extract_applicable_files(config, options)

linter_selector = SlimLint::LinterSelector.new(config, options)

lints =
if options[:stdin_file_path].nil?
files.map do |file|
collect_lints(File.read(file), file, linter_selector, config)
end.flatten
else
collect_lints($stdin.read, options[:stdin_file_path], linter_selector, config)
end
if options[:stdin_file_path].nil?
files = extract_applicable_files(config, options)
lints = files.map do |file|
collect_lints(File.read(file), file, linter_selector, config)
end.flatten
else
files = [options[:stdin_file_path]]
lints = collect_lints($stdin.read, options[:stdin_file_path], linter_selector, config)
end

SlimLint::Report.new(lints, files)
end
Expand Down

0 comments on commit 7caf453

Please sign in to comment.