14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/rspec/covers/formatter.rb', line 14
def dump_summary(_notification)
reporter = RSpec::Covers.reporter
return if reporter.results.empty?
@output.puts "\nrspec-covers:"
@output.puts " risky examples: #{reporter.risky_results.length}"
@output.puts " declaration warnings: #{reporter.validation_warnings.length}"
@output.puts " suggestions: #{reporter.suggestions.length}"
reporter.risky_results.each do |result|
@output.puts " risky: #{result.file}:#{result.line} #{result.description}"
result.verdict.grouped_evidence(limit: 5).each do |evidence|
@output.puts " #{evidence[:file]}:#{evidence[:lines].join(",")}"
@output.puts " methods: #{evidence[:methods].join(", ")}" if evidence[:methods].any?
@output.puts " note: #{evidence[:note]}" if evidence[:note]
end
end
reporter.validation_warnings.each do |result|
validation = result.declaration_validation
@output.puts " declaration warning: #{result.file}:#{result.line} #{result.description}"
@output.puts " weak: #{validation.unsupported_labels.join(", ")}"
end
reporter.results.each do |result|
next if Array(result.unchecked_locations).empty?
@output.puts colorize(" unchecked: #{result.file}:#{result.line} #{result.description}", 33)
result.unchecked_locations.group_by(&:file).each do |file, locations|
@output.puts colorize(" #{file}:#{locations.map(&:line).sort.join(",")}", 33)
end
end
end
|