simplecov-review 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1d9deaba10268b776c6498b55c64035273b4eef4f15321dc8e8d035f80408c2
4
- data.tar.gz: c5da36f9691120017450ac9ccb6d6d80fd1f347f40c567f043124bfef50a8888
3
+ metadata.gz: d469f2a7fbc2c8e9c341dda51f13d9a244d8ab65c1aabcded34f72436acd12d6
4
+ data.tar.gz: e13abeee2ba7cf814bb0f835c162a519f58bbf2d73aa521c068c7f52b60011c4
5
5
  SHA512:
6
- metadata.gz: d717454cfb87c084a8e93c63899059b77181d1d3679eff6236e70aae645503716721d7b8cf61dc70074a056772f16c08b1b81d7aa1fb849e304ae50600f403e3
7
- data.tar.gz: 29977bbafbf8b17916f63f0c8247af6da82b1c016c6f0309532e4c24e1057d363625e91bc1eca9ca517428af828d8d6297120df9e4e2eca4f34a8dc78e18cfdc
6
+ metadata.gz: 84e3ec8f6708a71c063064fa764f79ef5197d606c76e4a1e8c18fda483ea114e0ca6155a7ab5b5cbebd2be2e20231aeb72a7cb17dc78af3103de994c6c7fdbe4
7
+ data.tar.gz: c58bb7d3cdf6f0aa98f1c5f4b551abfb2c51bb7e15f03f0bb806c9c4c97ae867737d072de0be71541503144ff000f5d45a508cbe5b026679baef8011794baf9b
data/Gemfile.lock CHANGED
@@ -53,6 +53,7 @@ GEM
53
53
  unicode-display_width (2.1.0)
54
54
 
55
55
  PLATFORMS
56
+ arm64-darwin-21
56
57
  x86_64-darwin-18
57
58
  x86_64-linux
58
59
 
@@ -64,4 +65,4 @@ DEPENDENCIES
64
65
  simplecov-review!
65
66
 
66
67
  BUNDLED WITH
67
- 2.2.17
68
+ 2.2.22
@@ -3,7 +3,7 @@
3
3
  module SimpleCov
4
4
  module Formatter
5
5
  class ReviewFormatter
6
- VERSION = '0.1.0'
6
+ VERSION = '0.2.0'
7
7
  end
8
8
  end
9
9
  end
@@ -32,10 +32,29 @@ module SimpleCov
32
32
  end
33
33
 
34
34
  def find_missing_groups(file)
35
- lines_missing = file.lines.each_index.select { |index| file.lines[index].coverage&.zero? }.map { |l| l + 1 }
35
+ # assume line 0 is covered as well as the end of file, filter skipped coverage
36
+ lines_coverage = [1] + file.lines.map { |l| l.skipped? ? 1 : l.coverage } + [1]
37
+ lines_coverage = fill_blank_lines(lines_coverage)
38
+ lines_missing = lines_coverage.each_index.select { |index| lines_coverage[index].zero? }
36
39
  lines_missing.slice_when { |prev, curr| curr != prev.next }.to_a
37
40
  end
38
41
 
42
+ def fill_blank_lines(lines)
43
+ forward = fill_missing(lines.dup)
44
+ backward = fill_missing(lines.reverse).reverse
45
+
46
+ [forward, backward].transpose.map(&:compact).map(&:max)
47
+ end
48
+
49
+ def fill_missing(lines)
50
+ lines.each_index do |index|
51
+ next if index.zero?
52
+ next unless lines[index].nil?
53
+
54
+ lines[index] = lines[index - 1]
55
+ end
56
+ end
57
+
39
58
  def export_path
40
59
  File.join(SimpleCov.coverage_path, FILENAME)
41
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov-review
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karol Bąk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-19 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  requirements: []
67
- rubygems_version: 3.0.6
67
+ rubygems_version: 3.3.7
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: SimpleCov formatter to generate missing lines errors for reporting tools