Class: Evilution::CLI::Commands::Run Private

Inherits:
Evilution::CLI::Command show all
Defined in:
lib/evilution/cli/commands/run.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods inherited from Evilution::CLI::Command

#initialize

Constructor Details

This class inherits a constructor from Evilution::CLI::Command

Instance Method Details

#callObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/evilution/cli/commands/run.rb', line 16

def call
  file_options = Evilution::Config.file_options
  config = nil
  raise Evilution::ConfigError, @stdin_error if @stdin_error

  config = Evilution::Config.new(**@options, target_files: @files, line_ranges: @line_ranges)
  hooks = build_hooks(config)
  runner = Evilution::Runner.new(config: config, hooks: hooks)
  summary = runner.call
  exit_code = summary.success?(min_score: config.min_score) ? 0 : 1
  Evilution::CLI::Result.new(exit_code: exit_code)
rescue Evilution::Error => e
  handle_error(e, config, file_options)
end