lib/scss_lint/cli.rb in scss_lint-0.42.2 vs lib/scss_lint/cli.rb in scss_lint-0.43.0
- old
+ new
@@ -52,12 +52,20 @@
end
end
def scan_for_lints(options, config)
runner = Runner.new(config)
- runner.run(FileFinder.new(config).find(options[:files]))
- report_lints(options, runner.lints, runner.files)
+ files =
+ if options[:stdin_file_path]
+ [{ file: STDIN, path: options[:stdin_file_path] }]
+ else
+ FileFinder.new(config).find(options[:files]).map do |file_path|
+ { path: file_path }
+ end
+ end
+ runner.run(files)
+ report_lints(options, runner.lints, files)
if runner.lints.any?(&:error?)
halt :error
elsif runner.lints.any?
halt :warning
@@ -201,12 +209,10 @@
end
def print_linters
puts 'Installed linters:'
- linter_names = LinterRegistry.linters.map do |linter|
- linter.name.split('::').last
- end
+ linter_names = LinterRegistry.linters.map(&:simple_name)
linter_names.sort.each do |linter_name|
puts " - #{linter_name}"
end