simplecov-rspec 0.2.1 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.markdownlint.yml +25 -0
- data/.rubocop.yml +1 -1
- data/.yardopts +8 -0
- data/CHANGELOG.md +32 -0
- data/README.md +2 -2
- data/lib/simplecov-rspec/version.rb +1 -1
- data/lib/simplecov-rspec.rb +49 -13
- metadata +28 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 357d45f1e4b96c53d5522233609b282d46fddc7433f656649f0c5739e6a6cd4f
|
4
|
+
data.tar.gz: 39cfacd21df933b7f17b6eaa547bfd7caaf78e05cdede1a4e71eb2d5ecabcbf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fd6556e1261bdd178cf03afe828aadaf4ab9deb228dae5aaf51440e52b481808f53382d7c0e75073caf25d408802b94b91036ebae9a1ad791d5d5378a9b443a
|
7
|
+
data.tar.gz: d4129677343eb1099fff8e72286f023f09124551e8d73770c9aa2fecdb4624d09c4cdc4f3331ab5d2f21a2ffcdd5fa4294430457ff93aa3de7e2738d7eac4000
|
data/.markdownlint.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
default: true
|
2
|
+
|
3
|
+
# Unordered list indentation
|
4
|
+
MD007: { indent: 2 }
|
5
|
+
|
6
|
+
# Line length
|
7
|
+
MD013: { line_length: 90, tables: false, code_blocks: false }
|
8
|
+
|
9
|
+
# Heading duplication is allowed for non-sibling headings
|
10
|
+
MD024: { siblings_only: true }
|
11
|
+
|
12
|
+
# Do not allow the specified trailing punctuation in a header
|
13
|
+
MD026: { punctuation: '.,;:' }
|
14
|
+
|
15
|
+
# Order list items must have a prefix that increases in numerical order
|
16
|
+
MD029: { style: 'ordered' }
|
17
|
+
|
18
|
+
# Lists do not need to be surrounded by blank lines
|
19
|
+
MD032: false
|
20
|
+
|
21
|
+
# Allow raw HTML in Markdown
|
22
|
+
MD033: false
|
23
|
+
|
24
|
+
# Allow emphasis to be used instead of a heading
|
25
|
+
MD036: false
|
data/.rubocop.yml
CHANGED
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,38 @@ 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.1 (2024-09-16)
|
8
|
+
|
9
|
+
[Full Changelog](https://github.com/main-branch/simplecov-rspec/compare/v0.3.0..v0.3.1)
|
10
|
+
|
11
|
+
Changes since v0.3.0:
|
12
|
+
|
13
|
+
* 1fca720 Remove unneeded --exclude options in .yardopts
|
14
|
+
* e60794d Update yardopts with new standard options
|
15
|
+
* 31537ec Fix the YARD doc generation to use the correct license file name
|
16
|
+
* aebb048 Standardize YARD and Markdown Lint configurations
|
17
|
+
* 474adfb Update CODEOWNERS file
|
18
|
+
* ca1aca3 Document why the JRuby --debug flag is being set
|
19
|
+
* 8e0ad31 Set JRuby —debug option when running tests in GitHub Actions workflows
|
20
|
+
* fa10ba3 Fix example of uncovered lines listing in README
|
21
|
+
|
22
|
+
## v0.3.0 (2024-09-14)
|
23
|
+
|
24
|
+
[Full Changelog](https://github.com/main-branch/simplecov-rspec/compare/v0.2.1..v0.3.0)
|
25
|
+
|
26
|
+
Changes since v0.2.1:
|
27
|
+
|
28
|
+
* 55c3812 Output the number of lines missing coverage
|
29
|
+
* 9356f64 Rename variables from "lines_not_covered" to "uncovered_lines" to be consistent
|
30
|
+
* ec637c0 Fix error in README
|
31
|
+
* 9d9cb0c Rearrange workflow definitions to have the name first
|
32
|
+
* ac8efae Update continuous integration and experimental ruby builds
|
33
|
+
* ac1da92 Use v1 tag for the semver_pr_label_check workflow
|
34
|
+
* d701393 Auto-correct new Rubocop offenses
|
35
|
+
* 0319f68 Update minimal Ruby version to 3.1
|
36
|
+
* d6b57d1 Update code climate test coverage reporter version to v9
|
37
|
+
* 02553a1 Change simplecov from a development dependency to a runtime dependency
|
38
|
+
|
7
39
|
## v0.2.1 (2024-09-10)
|
8
40
|
|
9
41
|
[Full Changelog](https://github.com/main-branch/simplecov-rspec/compare/v0.2.0..v0.2.1)
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ FAIL: RSpec Test coverage fell below 100%
|
|
24
24
|
If configured to list the lines that were not covered by tests, RSpec will additionally output:
|
25
25
|
|
26
26
|
```text
|
27
|
-
|
27
|
+
2 lines are not covered by tests:
|
28
28
|
./lib/example_project.rb:74
|
29
29
|
./lib/example_project.rb:75
|
30
30
|
```
|
@@ -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
|
-
|
94
|
+
list_uncovered_lines: false
|
95
95
|
)
|
96
96
|
```
|
97
97
|
|
data/lib/simplecov-rspec.rb
CHANGED
@@ -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
|
-
|
290
|
-
$stderr.puts if show_low_coverage_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
|
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
|
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
|
320
|
+
# Whether to show the uncovered lines
|
321
321
|
# @return [Boolean]
|
322
322
|
# @api private
|
323
323
|
# @private
|
324
|
-
def
|
324
|
+
def show_uncovered_lines_report? = list_uncovered_lines? && uncovered_lines_found?
|
325
325
|
|
326
|
-
#
|
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
|
366
|
+
def uncovered_lines_report
|
331
367
|
$stderr.puts
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
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.
|
4
|
+
version: 0.3.1
|
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-
|
11
|
+
date: 2024-09-17 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.
|
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.
|
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.
|
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.
|
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
|
@@ -194,8 +194,10 @@ executables: []
|
|
194
194
|
extensions: []
|
195
195
|
extra_rdoc_files: []
|
196
196
|
files:
|
197
|
+
- ".markdownlint.yml"
|
197
198
|
- ".rspec"
|
198
199
|
- ".rubocop.yml"
|
200
|
+
- ".yardopts"
|
199
201
|
- CHANGELOG.md
|
200
202
|
- CODE_OF_CONDUCT.md
|
201
203
|
- LICENSE.txt
|
@@ -209,8 +211,8 @@ licenses:
|
|
209
211
|
metadata:
|
210
212
|
allowed_push_host: https://rubygems.org
|
211
213
|
homepage_uri: https://github.com/main-branch/simplecov-rspec
|
212
|
-
changelog_uri: https://rubydoc.info/gems/simplecov-rspec/0.
|
213
|
-
documentation_uri: https://rubydoc.info/gems/simplecov-rspec/0.
|
214
|
+
changelog_uri: https://rubydoc.info/gems/simplecov-rspec/0.3.1/file/CHANGELOG.md
|
215
|
+
documentation_uri: https://rubydoc.info/gems/simplecov-rspec/0.3.1
|
214
216
|
rubygems_mfa_required: 'true'
|
215
217
|
post_install_message:
|
216
218
|
rdoc_options: []
|
@@ -220,13 +222,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
220
222
|
requirements:
|
221
223
|
- - ">="
|
222
224
|
- !ruby/object:Gem::Version
|
223
|
-
version: 3.
|
225
|
+
version: 3.1.0
|
224
226
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
227
|
requirements:
|
226
228
|
- - ">="
|
227
229
|
- !ruby/object:Gem::Version
|
228
230
|
version: '0'
|
229
|
-
requirements:
|
231
|
+
requirements:
|
232
|
+
- 'Platform: Mac, Linux, or Windows'
|
233
|
+
- 'Ruby: MRI 3.1 or later, TruffleRuby 24 or later, or JRuby 9.4 or later'
|
230
234
|
rubygems_version: 3.5.16
|
231
235
|
signing_key:
|
232
236
|
specification_version: 4
|