Class: SimpleCov::Formatter::AIFormatter::MarkdownBuilder::BypassCompiler

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/simplecov-ai/markdown_builder/bypass_compiler.rb

Overview

Scans resolved AST blocks to report explicitly defined coverage ignores (e.g., :nocov:).

Instance Method Summary collapse

Constructor Details

#initialize(result, builder) ⇒ BypassCompiler

Returns a new instance of BypassCompiler.



13
14
15
16
# File 'lib/simplecov-ai/markdown_builder/bypass_compiler.rb', line 13

def initialize(result, builder)
  @result = result
  @builder = builder
end

Instance Method Details

#write_bypasses(buffer) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/simplecov-ai/markdown_builder/bypass_compiler.rb', line 19

def write_bypasses(buffer)
  bypass_buffer = T.let(StringIO.new, StringIO)
  has_bypasses = compile_all_bypasses(bypass_buffer)

  return unless has_bypasses

  buffer.puts "## Ignored Coverage Bypasses\n\n"
  buffer.puts bypass_buffer.string
end