Class: Rigor::CLI::CoverageCommand
- Inherits:
-
Object
- Object
- Rigor::CLI::CoverageCommand
- Defined in:
- lib/rigor/cli/coverage_command.rb
Overview
Executes the ‘rigor coverage` command.
Walks every Prism node in one or more files, infers its type via ‘Rigor::Scope#type_of`, and classifies the result into precision tiers (constant / nominal / shaped / refined / bot / dynamic_specific / dynamic_top / top). Reports aggregate and per-file statistics so maintainers can track type-precision trends and SKILL pipelines can measure the impact of adding new constant-fold or shape-dispatch rules.
Exit codes:
0 — scan complete, precision ratio ≥ threshold (or no threshold given)
1 — precision ratio < threshold, or parse errors encountered
64 — usage error
Constant Summary collapse
- USAGE =
"Usage: rigor coverage [options] PATH..."
Instance Method Summary collapse
-
#initialize(argv:, out:, err:) ⇒ CoverageCommand
constructor
A new instance of CoverageCommand.
-
#run ⇒ Integer
CLI exit status.
Constructor Details
#initialize(argv:, out:, err:) ⇒ CoverageCommand
Returns a new instance of CoverageCommand.
31 32 33 34 35 |
# File 'lib/rigor/cli/coverage_command.rb', line 31 def initialize(argv:, out:, err:) @argv = argv @out = out @err = err end |
Instance Method Details
#run ⇒ Integer
Returns CLI exit status.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rigor/cli/coverage_command.rb', line 38 def run = paths = collect_paths(@argv) return CLI::EXIT_USAGE if paths.nil? return usage_error if paths.empty? report = scan_paths(paths, ) CoverageRenderer.new(out: @out).render(report, format: .fetch(:format)) determine_exit(report, ) end |