simplecov-review 0.1.0 → 0.3.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: eb6c8e8592e2f0fb601195fa692b8ac08b3a814ace01fc430246b59fa74604af
4
+ data.tar.gz: 2e5f935c4df6a3e7c22a3e3f876b5506c5ee949565a1f803f390a5445fdf1bdc
5
5
  SHA512:
6
- metadata.gz: d717454cfb87c084a8e93c63899059b77181d1d3679eff6236e70aae645503716721d7b8cf61dc70074a056772f16c08b1b81d7aa1fb849e304ae50600f403e3
7
- data.tar.gz: 29977bbafbf8b17916f63f0c8247af6da82b1c016c6f0309532e4c24e1057d363625e91bc1eca9ca517428af828d8d6297120df9e4e2eca4f34a8dc78e18cfdc
6
+ metadata.gz: 30ca89e277e54957aff346c3268d6c4b676c5c9513b332fac73a34f9e25cdac675e65da136618ed799476af61ffabfc09b6b8b8ddb64504705dbb346bdaa9c40
7
+ data.tar.gz: 0a3badc1ce1dfa575bc8c47811e97f495fc3bcf0653c05e000e62e05164bbdf1679c83300a170459ae2ca70f3ddc8ecb84124a0ca0fa6deae444e58add717911
@@ -8,9 +8,9 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [2.5, 2.6, 2.7, 3.0]
11
+ ruby: [2.5, 2.6, 2.7, 3.0.5, 3.1, 3.2, 3.3]
12
12
  steps:
13
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v4
14
14
  - name: Set up Ruby
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
data/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
- ## [Unreleased]
1
+ ## [0.3.0] - 2024-09-22
2
+
3
+ - allow simplecov 0.22 as dependency
4
+ - include ruby 3.x in test suite
5
+
6
+ ## [0.2.0] - 2022-07-11
7
+
8
+ - improve lines grouping
9
+ - add support for `:nocov:`
2
10
 
3
11
  ## [0.1.0] - 2021-10-19
4
12
 
data/Gemfile.lock CHANGED
@@ -1,18 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simplecov-review (0.1.0)
5
- simplecov (~> 0.21.2)
4
+ simplecov-review (0.3.0)
5
+ simplecov (>= 0.21.2, < 0.23)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
11
  diff-lcs (1.4.4)
12
- docile (1.3.5)
12
+ docile (1.4.1)
13
13
  parallel (1.21.0)
14
- parser (3.0.2.0)
14
+ parser (3.3.5.0)
15
15
  ast (~> 2.4.1)
16
+ racc
17
+ racc (1.8.1)
16
18
  rainbow (3.0.0)
17
19
  rake (13.0.6)
18
20
  regexp_parser (2.1.1)
@@ -44,15 +46,17 @@ GEM
44
46
  rubocop-rspec (2.5.0)
45
47
  rubocop (~> 1.19)
46
48
  ruby-progressbar (1.11.0)
47
- simplecov (0.21.2)
49
+ simplecov (0.22.0)
48
50
  docile (~> 1.1)
49
51
  simplecov-html (~> 0.11)
50
52
  simplecov_json_formatter (~> 0.1)
51
- simplecov-html (0.12.3)
52
- simplecov_json_formatter (0.1.2)
53
+ simplecov-html (0.13.1)
54
+ simplecov_json_formatter (0.1.4)
53
55
  unicode-display_width (2.1.0)
54
56
 
55
57
  PLATFORMS
58
+ arm64-darwin-21
59
+ arm64-darwin-23
56
60
  x86_64-darwin-18
57
61
  x86_64-linux
58
62
 
@@ -64,4 +68,4 @@ DEPENDENCIES
64
68
  simplecov-review!
65
69
 
66
70
  BUNDLED WITH
67
- 2.2.17
71
+ 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.3.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
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
  end
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_dependency 'simplecov', '~> 0.21.2'
25
+ spec.add_dependency 'simplecov', '>= 0.21.2', '< 0.23'
26
26
  end
metadata CHANGED
@@ -1,29 +1,35 @@
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.3.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: 2024-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.21.2
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '0.23'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 0.21.2
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.23'
27
33
  description:
28
34
  email:
29
35
  - kukicola@gmail.com
@@ -64,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
70
  - !ruby/object:Gem::Version
65
71
  version: '0'
66
72
  requirements: []
67
- rubygems_version: 3.0.6
73
+ rubygems_version: 3.3.7
68
74
  signing_key:
69
75
  specification_version: 4
70
76
  summary: SimpleCov formatter to generate missing lines errors for reporting tools