class RuboCop::CLI

def run(args = ARGV)

Returns:
  • (Fixnum) - UNIX exit code
def run(args = ARGV)
  @options, paths = Options.new.parse(args)
  act_on_options
  runner = Runner.new(@options, @config_store)
  trap_interrupt(runner)
  all_passed = runner.run(paths)
  display_error_summary(runner.errors)
  all_passed && !runner.aborting? ? 0 : 1
rescue Cop::AmbiguousCopName => e
  $stderr.puts "Ambiguous cop name #{e.message} needs namespace " \
               'qualifier.'
  return 1
rescue => e
  $stderr.puts e.message
  $stderr.puts e.backtrace
  return 1
end