Class: SimpleCov::Formatter::JSONFormatter::ErrorsFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov/formatter/json_formatter/errors_formatter.rb

Overview

Translates the threshold violations reported by SimpleCov::CoverageViolations into the :errors section of coverage.json. Each violation is keyed by criterion (:lines / :branches / :methods) so consumers can render per-criterion messages without re-deriving them.

Class Method Summary collapse

Class Method Details

.call(result) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/simplecov/formatter/json_formatter/errors_formatter.rb', line 16

def call(result)
  errors = {} #: Hash[Symbol, Hash[untyped, untyped]]
  format_minimum_overall(result, errors)
  format_minimum_by_file(result, errors)
  format_minimum_by_group(result, errors)
  format_maximum_overall(result, errors)
  format_maximum_drop(result, errors)
  errors
end