Class: Rigor::CLI::TriageCommand
- Inherits:
-
Object
- Object
- Rigor::CLI::TriageCommand
- Defined in:
- lib/rigor/cli/triage_command.rb
Overview
ADR-23 — executes ‘rigor triage`.
Runs the same analysis as ‘rigor check`, then summarises the diagnostic stream (rule distribution, per-file hotspots, heuristic hints) instead of printing the raw per-line list. Read-only and advisory (WD4): never edits config, never writes a baseline. Always exits 0 — it is an inspection command, not a gate (`rigor check` remains the gate).
Constant Summary collapse
- USAGE =
"Usage: rigor triage [options] [paths]"- DEFAULT_SECTIONS =
%i[distribution hotspots hints].freeze
Instance Method Summary collapse
-
#initialize(argv:, out:, err:) ⇒ TriageCommand
constructor
A new instance of TriageCommand.
-
#run ⇒ Integer
CLI exit status (always 0).
Constructor Details
#initialize(argv:, out:, err:) ⇒ TriageCommand
Returns a new instance of TriageCommand.
25 26 27 28 29 |
# File 'lib/rigor/cli/triage_command.rb', line 25 def initialize(argv:, out:, err:) @argv = argv @out = out @err = err end |
Instance Method Details
#run ⇒ Integer
Returns CLI exit status (always 0).
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rigor/cli/triage_command.rb', line 32 def run = configuration = Configuration.load(.fetch(:config)) diagnostics = analyze(configuration) report = Triage.analyze(diagnostics, top: .fetch(:top), hints: .fetch(:sections).include?(:hints)) renderer = TriageRenderer.new(report, sections: .fetch(:sections)) @out.puts(.fetch(:format) == "json" ? renderer.json : renderer.text) 0 end |