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 +4 -4
- data/Gemfile.lock +2 -1
- data/lib/simplecov-review/version.rb +1 -1
- data/lib/simplecov-review.rb +20 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d469f2a7fbc2c8e9c341dda51f13d9a244d8ab65c1aabcded34f72436acd12d6
|
4
|
+
data.tar.gz: e13abeee2ba7cf814bb0f835c162a519f58bbf2d73aa521c068c7f52b60011c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84e3ec8f6708a71c063064fa764f79ef5197d606c76e4a1e8c18fda483ea114e0ca6155a7ab5b5cbebd2be2e20231aeb72a7cb17dc78af3103de994c6c7fdbe4
|
7
|
+
data.tar.gz: c58bb7d3cdf6f0aa98f1c5f4b551abfb2c51bb7e15f03f0bb806c9c4c97ae867737d072de0be71541503144ff000f5d45a508cbe5b026679baef8011794baf9b
|
data/Gemfile.lock
CHANGED
data/lib/simplecov-review.rb
CHANGED
@@ -32,10 +32,29 @@ module SimpleCov
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def find_missing_groups(file)
|
35
|
-
|
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.
|
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:
|
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.
|
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
|