Class: Rigor::CLI::TypeScanCommand
- Inherits:
-
Object
- Object
- Rigor::CLI::TypeScanCommand
- Defined in:
- lib/rigor/cli/type_scan_command.rb
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`.
Defined Under Namespace
Classes: LocatedEvent, ScanAccumulator
Constant Summary collapse
- USAGE =
"Usage: rigor type-scan [options] PATH..."
Instance Method Summary collapse
-
#initialize(argv:, out:, err:) ⇒ TypeScanCommand
constructor
A new instance of TypeScanCommand.
-
#run ⇒ Integer
CLI exit status.
Constructor Details
#initialize(argv:, out:, err:) ⇒ TypeScanCommand
Returns a new instance of TypeScanCommand.
26 27 28 29 30 |
# File 'lib/rigor/cli/type_scan_command.rb', line 26 def initialize(argv:, out:, err:) @argv = argv @out = out @err = err end |
Instance Method Details
#run ⇒ Integer
Returns CLI exit status.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rigor/cli/type_scan_command.rb', line 33 def run = paths = collect_paths(@argv) return CLI::EXIT_USAGE if paths.nil? return usage_error if paths.empty? report = scan_paths(paths, ) TypeScanRenderer.new(out: @out).render(report, format: .fetch(:format)) determine_exit(report, ) end |