Class: 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
-
#run ⇒ Integer
CLI exit status (always 0).
Methods inherited from Command
Constructor Details
This class inherits a constructor from Rigor::CLI::Command
Instance Method Details
#run ⇒ Integer
Returns CLI exit status (always 0).
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rigor/cli/triage_command.rb', line 27 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 |