lib/scss_lint/cli.rb in scss_lint-0.39.0 vs lib/scss_lint/cli.rb in scss_lint-0.40.0
- old
+ new
@@ -18,10 +18,11 @@
unavailable: 69, # Required library is unavailable
software: 70, # Internal software error
config: 78, # Configuration error
no_files: 80, # No files matched by specified glob patterns
files_filtered: 81, # All matched files were filtered by exclusions
+ plugin: 82, # Plugin loading error
}
def run(args)
options = SCSSLint::Options.new.parse(args)
act_on_options(options)
@@ -37,17 +38,20 @@
if options[:help]
print_help(options)
elsif options[:version]
print_version
- elsif options[:show_linters]
- print_linters
elsif options[:show_formatters]
print_formatters
else
config = setup_configuration(options)
- scan_for_lints(options, config)
+
+ if options[:show_linters]
+ print_linters
+ else
+ scan_for_lints(options, config)
+ end
end
end
def scan_for_lints(options, config)
runner = Runner.new(config)
@@ -79,9 +83,12 @@
puts exception.message
halt :files_filtered
when SCSSLint::Exceptions::NoFilesError
puts exception.message
halt :no_files
+ when SCSSLint::Exceptions::PluginGemLoadError
+ puts exception.message
+ halt :plugin
when Errno::ENOENT
puts exception.message
halt :no_input
when NoSuchLinter
puts exception.message