Class: Rigor::CLI::TypeScanCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/rigor/cli/type_scan_command.rb,
sig/rigor.rbs

Overview

Executes the rigor type-scan command.

The command walks every Prism node in one or more files, runs Rigor::Scope#type_of on each, and reports per-node-class coverage of the inference engine's directly recognized classes. It is the project's primary CI gate for tracking how much of an input source the engine can name without falling back to Dynamic[Top].

Defined Under Namespace

Classes: LocatedEvent, ScanAccumulator

Constant Summary collapse

USAGE =

Returns:

  • (String)
"Usage: rigor type-scan [options] PATH..."

Instance Method Summary collapse

Constructor Details

#initializeTypeScanCommand

Returns a new instance of TypeScanCommand.

Parameters:

  • argv: (Array[String])
  • out: (Object)
  • err: (Object)


39
# File 'sig/rigor.rbs', line 39

def initialize: (argv: Array[String], out: untyped, err: untyped) -> void

Instance Method Details

#runInteger

Returns CLI exit status.

Returns:

  • (Integer)

    CLI exit status.



28
29
30
31
32
33
34
35
36
37
# File 'lib/rigor/cli/type_scan_command.rb', line 28

def run
  options = parse_options
  paths = collect_paths(@argv, command_name: "type-scan")
  return CLI::EXIT_USAGE if paths.nil?
  return usage_error if paths.empty?

  report = scan_paths(paths, options)
  TypeScanRenderer.new(out: @out).render(report, format: options.fetch(:format))
  determine_exit(report, options)
end