Class: Rigor::CLI::CoverageCommand
- Includes:
- CoverageMutation
- 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..."- DEFAULT_TEST_COMMAND =
ADR-70 — the default test runner hook for ‘–with-tests`. The conventional Ruby test task; override with `–test-command`.
%w[bundle exec rake].freeze
Instance Method Summary collapse
-
#run ⇒ Integer
CLI exit status.
Methods inherited from Command
Constructor Details
This class inherits a constructor from Rigor::CLI::Command
Instance Method Details
#run ⇒ Integer
Returns CLI exit status.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/rigor/cli/coverage_command.rb', line 55 def run = return mutation_misuse_error if [:mutation] && ![:protection] return with_tests_misuse_error if [:with_tests] && ![:mutation] return include_dynamic_misuse_error if [:include_dynamic] && ![:with_tests] return run_mutation_protection() if [:mutation] paths = collect_paths(@argv, command_name: "coverage") return CLI::EXIT_USAGE if paths.nil? return usage_error if paths.empty? return run_protection(paths, ) if [:protection] report = scan_paths(paths, ) CoverageRenderer.new(out: @out).render(report, format: .fetch(:format)) determine_exit(report, ) end |