Class: Rigor::CLI::MutationProtectionRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/rigor/cli/mutation_protection_renderer.rb

Overview

Renders a MutationProtectionReport (ADR-63 Tier 2) as text or JSON. The text form leads with the effectiveness ratio (caught breakages), then the breakages Rigor missed ("add a type here"), then the least-effective files. The framing is always where to add a type, never "your code is broken".

Constant Summary collapse

TOP_CALLS =
15
TOP_FILES =
10

Instance Method Summary collapse

Constructor Details

#initialize(out:) ⇒ MutationProtectionRenderer

Returns a new instance of MutationProtectionRenderer.



14
15
16
# File 'lib/rigor/cli/mutation_protection_renderer.rb', line 14

def initialize(out:)
  @out = out
end

Instance Method Details

#render(report, format:) ⇒ Object



18
19
20
# File 'lib/rigor/cli/mutation_protection_renderer.rb', line 18

def render(report, format:)
  format == "json" ? render_json(report) : render_text(report)
end