simplecov-rspec 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f85ad1153e6f9763be15065fb878d655e678c2b25822fc0cfd0c34702d8555f
4
- data.tar.gz: efb0fcb94e7391d3d2179fa77d31a1964bcdce7de6f84c503e9deb082c9d1b12
3
+ metadata.gz: 862cb86ed8d8fab68c4634038cd69abedf062c091da28dfbf58505ef1063d4dc
4
+ data.tar.gz: a05ec0c099ccb49a93a338d28b34766740d1fbbd0fe6d2b7bf53f3037f506da7
5
5
  SHA512:
6
- metadata.gz: 0507b2f6bcc191dcde75aa43c5a78b808fbb0437b1894751028e44f31c96b5f07499a837aa768e681d8b0ba149363ddb3c410e2a677c053383de24dfb32efd39
7
- data.tar.gz: 65a297b875d450c10533d0186ccc5612ab9687a9b8fc2074528713d377ff3d37f3713128a0f8ba08976674c3566c1bf5b91bd4316687f8f9c7de79eafee9c5c7
6
+ metadata.gz: f4d675d09258f5803030dd292da7bc89dfee3c8ba1dc3b0380470230dc02c495cfaaaac5473cba5bfcc29de665d9de2e3dbe123697ec3cde338caf1ddd5223ae
7
+ data.tar.gz: e25a543369fc68e01a7cc7ba43d43c15b387e0339237e9bc8f01f2d5fd527f030616ca5a9494a6142e36c7104804c17cc41dcc740b78edc8e69453e8862f7d4b
data/.rubocop.yml CHANGED
@@ -10,7 +10,7 @@ AllCops:
10
10
 
11
11
  # RuboCop enforces rules depending on the oldest version of Ruby which
12
12
  # your project supports:
13
- TargetRubyVersion: 3.0
13
+ TargetRubyVersion: 3.1
14
14
 
15
15
  Gemspec/DevelopmentDependencies:
16
16
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -4,6 +4,34 @@ Changes for each release are listed in this file.
4
4
 
5
5
  This project adheres to [Semantic Versioning](https://semver.org/) for its releases.
6
6
 
7
+ ## v0.3.0 (2024-09-14)
8
+
9
+ [Full Changelog](https://github.com/main-branch/simplecov-rspec/compare/v0.2.1..v0.3.0)
10
+
11
+ Changes since v0.2.1:
12
+
13
+ * 55c3812 Output the number of lines missing coverage
14
+ * 9356f64 Rename variables from "lines_not_covered" to "uncovered_lines" to be consistent
15
+ * ec637c0 Fix error in README
16
+ * 9d9cb0c Rearrange workflow definitions to have the name first
17
+ * ac8efae Update continuous integration and experimental ruby builds
18
+ * ac1da92 Use v1 tag for the semver_pr_label_check workflow
19
+ * d701393 Auto-correct new Rubocop offenses
20
+ * 0319f68 Update minimal Ruby version to 3.1
21
+ * d6b57d1 Update code climate test coverage reporter version to v9
22
+ * 02553a1 Change simplecov from a development dependency to a runtime dependency
23
+
24
+ ## v0.2.1 (2024-09-10)
25
+
26
+ [Full Changelog](https://github.com/main-branch/simplecov-rspec/compare/v0.2.0..v0.2.1)
27
+
28
+ Changes since v0.2.0:
29
+
30
+ * d714b58 Simplify how the experimental ruby builds are triggered
31
+ * de79d66 Use a reusable workflow for the Semver PR label check
32
+ * d29ecac Add Semver PR Label workflow
33
+ * 0fed875 Update the version of code climate test coverage reporter
34
+
7
35
  ## v0.2.0 (2024-09-08)
8
36
 
9
37
  [Full Changelog](https://github.com/main-branch/simplecov-rspec/compare/v0.1.0..v0.2.0)
data/README.md CHANGED
@@ -91,7 +91,7 @@ This is equivalent to starting with the following options:
91
91
  SimpleCov::RSpec.start(
92
92
  coverage_threshold: 100,
93
93
  fail_on_low_coverage: true,
94
- list_lines_not_covered: false
94
+ list_uncovered_lines: false
95
95
  )
96
96
  ```
97
97
 
@@ -3,6 +3,6 @@
3
3
  module Simplecov
4
4
  class Rspec
5
5
  # This gem's version
6
- VERSION = '0.2.0'
6
+ VERSION = '0.3.0'
7
7
  end
8
8
  end
@@ -286,11 +286,11 @@ module SimpleCov
286
286
  # @private
287
287
  def output_at_exit_report
288
288
  low_coverage_report if show_low_coverage_report?
289
- lines_not_covered_report if show_lines_not_covered_report?
290
- $stderr.puts if show_low_coverage_report? || show_lines_not_covered_report?
289
+ uncovered_lines_report if show_uncovered_lines_report?
290
+ $stderr.puts if show_low_coverage_report? || show_uncovered_lines_report?
291
291
  end
292
292
 
293
- # Whether to show the low coverage report
293
+ # Whether to show the low coverage
294
294
  # @return [Boolean]
295
295
  # @api private
296
296
  # @private
@@ -302,7 +302,7 @@ module SimpleCov
302
302
  # @private
303
303
  def coverage_below_threshold? = simplecov_module.result.covered_percent < coverage_threshold
304
304
 
305
- # Output the low coverage part of the at_exit report
305
+ # Output the low coverage report
306
306
  # @return [Void]
307
307
  # @api private
308
308
  # @private
@@ -317,23 +317,59 @@ module SimpleCov
317
317
  # @api private
318
318
  def uncovered_lines_found? = simplecov_module.result.files.any? { |source_file| source_file.missed_lines.any? }
319
319
 
320
- # Whether to show lines not covered report
320
+ # Whether to show the uncovered lines
321
321
  # @return [Boolean]
322
322
  # @api private
323
323
  # @private
324
- def show_lines_not_covered_report? = list_uncovered_lines? && uncovered_lines_found?
324
+ def show_uncovered_lines_report? = list_uncovered_lines? && uncovered_lines_found?
325
325
 
326
- # Output the lines not covered part of the at_exit report
326
+ # An uncovered line
327
+ #
328
+ # @!attribute project_filename [rw]
329
+ # The path to the file with uncovered lines relative to the project root
330
+ # @return [String]
331
+ # @api private
332
+ #
333
+ # @!attribute line_number [rw]
334
+ # The line number of the uncovered line
335
+ # @return [Integer]
336
+ # @api private
337
+ #
338
+ # @api private
339
+ UncoveredLine = Struct.new(:project_filename, :line_number)
340
+
341
+ # Return the uncovered lines from the SimpleCov result
342
+ # @return [Array<UncoveredLine>]
343
+ # @api private
344
+ def uncovered_lines
345
+ @uncovered_lines ||=
346
+ simplecov_module.result.files.flat_map do |source_file|
347
+ source_file.missed_lines.map do |line|
348
+ project_filename = File.join('.', source_file.project_filename)
349
+ UncoveredLine.new(project_filename, line.number)
350
+ end
351
+ end
352
+ end
353
+
354
+ # Return the singular or plural form of a word based on the count
355
+ # @param count [Integer] the count
356
+ # @param singular [String] the singular form of the phrase
357
+ # @param plural [String] the plural form of the phrase
358
+ # @return [String]
359
+ # @api private
360
+ def pluralize(count, singular, plural) = count == 1 ? singular : plural
361
+
362
+ # Output the uncovered lines
327
363
  # @return [Void]
328
364
  # @api private
329
365
  # @private
330
- def lines_not_covered_report
366
+ def uncovered_lines_report
331
367
  $stderr.puts
332
- $stderr.puts "The following lines were not covered by tests:\n"
333
- simplecov_module.result.files.each do |source_file| # SimpleCov::SourceFile
334
- source_file.missed_lines.each do |line| # SimpleCov::SourceFile::Line
335
- $stderr.puts " ./#{source_file.project_filename}:#{line.number}"
336
- end
368
+ count = uncovered_lines.count
369
+ things = pluralize(uncovered_lines.count, 'line is', 'lines are')
370
+ $stderr.puts "#{count} #{things} not covered by tests:\n"
371
+ uncovered_lines.each do |uncovered_line|
372
+ $stderr.puts " #{uncovered_line.project_filename}:#{uncovered_line.line_number}"
337
373
  end
338
374
  end
339
375
 
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Couball
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-08 00:00:00.000000000 Z
11
+ date: 2024-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: simplecov
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.22'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.22'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler-audit
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -30,14 +44,14 @@ dependencies:
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '1.4'
47
+ version: '1.5'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '1.4'
54
+ version: '1.5'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: fuubar
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,28 +100,14 @@ dependencies:
86
100
  requirements:
87
101
  - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: '1.64'
103
+ version: '1.66'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: '1.64'
97
- - !ruby/object:Gem::Dependency
98
- name: simplecov
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '0.22'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '0.22'
110
+ version: '1.66'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov-lcov
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -209,8 +209,8 @@ licenses:
209
209
  metadata:
210
210
  allowed_push_host: https://rubygems.org
211
211
  homepage_uri: https://github.com/main-branch/simplecov-rspec
212
- changelog_uri: https://rubydoc.info/gems/simplecov-rspec/0.2.0/file/CHANGELOG.md
213
- documentation_uri: https://rubydoc.info/gems/simplecov-rspec/0.2.0
212
+ changelog_uri: https://rubydoc.info/gems/simplecov-rspec/0.3.0/file/CHANGELOG.md
213
+ documentation_uri: https://rubydoc.info/gems/simplecov-rspec/0.3.0
214
214
  rubygems_mfa_required: 'true'
215
215
  post_install_message:
216
216
  rdoc_options: []
@@ -220,13 +220,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
220
220
  requirements:
221
221
  - - ">="
222
222
  - !ruby/object:Gem::Version
223
- version: 3.0.0
223
+ version: 3.1.0
224
224
  required_rubygems_version: !ruby/object:Gem::Requirement
225
225
  requirements:
226
226
  - - ">="
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
- requirements: []
229
+ requirements:
230
+ - 'Platform: Mac, Linux, or Windows'
231
+ - 'Ruby: MRI 3.1 or later, TruffleRuby 24 or later, or JRuby 9.4 or later'
230
232
  rubygems_version: 3.5.16
231
233
  signing_key:
232
234
  specification_version: 4