class SimpleCov::Formatter::LinterFormatter

Public Instance Methods

format(simplecov_result) click to toggle source
# File lib/simplecov_linter_formatter.rb, line 93
def format(simplecov_result)
  text_lines = get_text_lines(simplecov_result)
  show_coverage_summary(text_lines)
  hash_result = format_text_lines(simplecov_result.command_name, text_lines)
  export_to_json(hash_result)
  nil
end

Private Instance Methods

export_to_json(hash_result) click to toggle source
# File lib/simplecov_linter_formatter.rb, line 128
def export_to_json(hash_result)
  SimpleCovLinterFormatter::JsonResultExporter.new(hash_result).export
end
filter_text_lines(text_lines) click to toggle source
# File lib/simplecov_linter_formatter.rb, line 116
def filter_text_lines(text_lines)
  SimpleCovLinterFormatter::TextLinesFilter.new(text_lines).filter
end
format_result(simplecov_result) click to toggle source
# File lib/simplecov_linter_formatter.rb, line 120
def format_result(simplecov_result)
  SimpleCovLinterFormatter::ResultFormatter.new(simplecov_result).format
end
format_text_lines(command_name, text_lines) click to toggle source
# File lib/simplecov_linter_formatter.rb, line 124
def format_text_lines(command_name, text_lines)
  SimpleCovLinterFormatter::TextLinesFormatter.new(command_name, text_lines).format
end
get_text_lines(simplecov_result) click to toggle source
# File lib/simplecov_linter_formatter.rb, line 103
def get_text_lines(simplecov_result)
  text_lines = format_result(simplecov_result)
  return text_lines if SimpleCovLinterFormatter.cover_all?

  filter_text_lines(text_lines)
end
show_coverage_summary(text_lines) click to toggle source
# File lib/simplecov_linter_formatter.rb, line 110
def show_coverage_summary(text_lines)
  return unless SimpleCovLinterFormatter.summary_enabled

  puts(SimpleCovLinterFormatter::SummaryBuilder.new(text_lines).build)
end