123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::Server::ServerCommand::Exec Private

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Base
Instance Chain:
self, Base
Inherits: RuboCop::Server::ServerCommand::Base
Defined in: lib/rubocop/server/server_command/exec.rb

Overview

This class is a server command to execute rubocop command using RuboCop::CLI.new#run.

Class Method Summary

Base - Inherited

Instance Method Summary

Base - Inherited

Instance Method Details

#run

[ GitHub ]

  
# File 'lib/rubocop/server/server_command/exec.rb', line 18

def run
  # RuboCop output is colorized by default where there is a TTY.
  # We must pass the --color option to preserve this behavior.
  @args.unshift('--color') unless %w[--color --no-color].any? { |f| @args.include?(f) }
  status = RuboCop::CLI.new.run(@args)
  # This status file is read by `rubocop --server` (`RuboCop::Server::ClientCommand::Exec`).
  # so that they use the correct exit code.
  # Status is 1 when there are any issues, and 0 otherwise.
  Cache.write_status_file(status)
rescue SystemExit
  Cache.write_status_file(1)
end