simple_cov-formatter-terminal 1.8.0 → 1.9.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +34 -32
- data/README.md +6 -1
- data/lib/simple_cov/formatter/terminal/branch_coverage.rb +2 -2
- data/lib/simple_cov/formatter/terminal/file_determiner.rb +1 -1
- data/lib/simple_cov/formatter/terminal/r_spec_integration.rb +1 -1
- data/lib/simple_cov/formatter/terminal/result_printer.rb +38 -28
- data/lib/simple_cov/formatter/terminal/version.rb +1 -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: 9097ea695f30e44ce30001f876d6f54a7692b0500734a4a2681a753b2a685407
|
4
|
+
data.tar.gz: 415877eb22dfcfb888cbff4c40d453e7889214facfa3e2e7f8870750a16f823f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3906ff2828ba8a653922bcf434400381c9e6ba98b50b569f1bfb7167c7c273ebc823a12d76fd1399ef71a6b589fe688071f16e9220c7b7d2f0b191b89fce1ed7
|
7
|
+
data.tar.gz: e23b7894b2d161eb8da779bb7258106dadf2461ae4e90343b7db543488549ea99cea0c1d24794947d421c5e7ca2a4d09f9110dbc21582a92a337cebdccd3bed0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## Unreleased
|
2
|
+
[no unreleased changes yet]
|
3
|
+
|
4
|
+
## v1.9.0 (2025-04-03)
|
5
|
+
- Support specifying a range (or ranges) of lines for which to show coverage via a `SIMPLECOV_TERMINAL_LINES` environment variable.
|
6
|
+
|
1
7
|
## v1.8.0 (2025-03-12)
|
2
8
|
- Support disabling via `DISABLE_SIMPLECOV_TERMINAL` environment variable.
|
3
9
|
|
data/Gemfile
CHANGED
@@ -12,7 +12,6 @@ gemspec
|
|
12
12
|
group :development, :test do
|
13
13
|
gem 'bundler', require: false
|
14
14
|
gem 'pry'
|
15
|
-
# Go back to upstream if/when https://github.com/deivid-rodriguez/pry-byebug/pull/ 428 is merged.
|
16
15
|
gem 'pry-byebug', github: 'davidrunger/pry-byebug'
|
17
16
|
gem 'rubocop', require: false
|
18
17
|
gem 'rubocop-performance', require: false
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/davidrunger/pry-byebug
|
3
|
-
revision:
|
3
|
+
revision: 0b596b133d49f9d1dcf7bd6210604cfd60c45cba
|
4
4
|
specs:
|
5
5
|
pry-byebug (3.10.1)
|
6
6
|
pry (>= 0.13)
|
@@ -9,7 +9,7 @@ GIT
|
|
9
9
|
PATH
|
10
10
|
remote: .
|
11
11
|
specs:
|
12
|
-
simple_cov-formatter-terminal (1.
|
12
|
+
simple_cov-formatter-terminal (1.9.0)
|
13
13
|
activesupport (>= 7.0.4)
|
14
14
|
memo_wise (>= 1.7.0)
|
15
15
|
rouge (>= 4.0.0)
|
@@ -33,7 +33,7 @@ GEM
|
|
33
33
|
securerandom (>= 0.3)
|
34
34
|
tzinfo (~> 2.0, >= 2.0.5)
|
35
35
|
uri (>= 0.13.1)
|
36
|
-
ast (2.4.
|
36
|
+
ast (2.4.3)
|
37
37
|
base64 (0.2.0)
|
38
38
|
benchmark (0.4.0)
|
39
39
|
bigdecimal (3.1.9)
|
@@ -42,7 +42,7 @@ GEM
|
|
42
42
|
concurrent-ruby (1.3.5)
|
43
43
|
connection_pool (2.5.0)
|
44
44
|
date (3.4.1)
|
45
|
-
diff-lcs (1.6.
|
45
|
+
diff-lcs (1.6.1)
|
46
46
|
docile (1.4.1)
|
47
47
|
drb (2.2.1)
|
48
48
|
i18n (1.14.7)
|
@@ -55,18 +55,18 @@ GEM
|
|
55
55
|
json (2.10.2)
|
56
56
|
language_server-protocol (3.17.0.4)
|
57
57
|
lint_roller (1.1.0)
|
58
|
-
logger (1.
|
58
|
+
logger (1.7.0)
|
59
59
|
memo_wise (1.11.0)
|
60
60
|
method_source (1.1.0)
|
61
|
-
minitest (5.25.
|
61
|
+
minitest (5.25.5)
|
62
62
|
parallel (1.26.3)
|
63
|
-
parser (3.3.7.
|
63
|
+
parser (3.3.7.4)
|
64
64
|
ast (~> 2.4.1)
|
65
65
|
racc
|
66
66
|
pp (0.6.2)
|
67
67
|
prettyprint
|
68
68
|
prettyprint (0.2.0)
|
69
|
-
prism (1.
|
69
|
+
prism (1.4.0)
|
70
70
|
pry (0.15.2)
|
71
71
|
coderay (~> 1.1)
|
72
72
|
method_source (~> 1.0)
|
@@ -76,7 +76,7 @@ GEM
|
|
76
76
|
racc (1.8.1)
|
77
77
|
rainbow (3.1.1)
|
78
78
|
rake (13.2.1)
|
79
|
-
rdoc (6.
|
79
|
+
rdoc (6.13.1)
|
80
80
|
psych (>= 4.0.0)
|
81
81
|
regexp_parser (2.10.0)
|
82
82
|
reline (0.6.0)
|
@@ -96,7 +96,7 @@ GEM
|
|
96
96
|
diff-lcs (>= 1.2.0, < 2.0)
|
97
97
|
rspec-support (~> 3.13.0)
|
98
98
|
rspec-support (3.13.2)
|
99
|
-
rubocop (1.
|
99
|
+
rubocop (1.75.1)
|
100
100
|
json (~> 2.3)
|
101
101
|
language_server-protocol (~> 3.17.0.2)
|
102
102
|
lint_roller (~> 1.1.0)
|
@@ -104,14 +104,15 @@ GEM
|
|
104
104
|
parser (>= 3.3.0.2)
|
105
105
|
rainbow (>= 2.2.2, < 4.0)
|
106
106
|
regexp_parser (>= 2.9.3, < 3.0)
|
107
|
-
rubocop-ast (>= 1.
|
107
|
+
rubocop-ast (>= 1.43.0, < 2.0)
|
108
108
|
ruby-progressbar (~> 1.7)
|
109
109
|
unicode-display_width (>= 2.4.0, < 4.0)
|
110
|
-
rubocop-ast (1.
|
111
|
-
parser (>= 3.3.
|
112
|
-
|
110
|
+
rubocop-ast (1.44.0)
|
111
|
+
parser (>= 3.3.7.2)
|
112
|
+
prism (~> 1.4)
|
113
|
+
rubocop-performance (1.25.0)
|
113
114
|
lint_roller (~> 1.1)
|
114
|
-
rubocop (>= 1.
|
115
|
+
rubocop (>= 1.75.0, < 2.0)
|
115
116
|
rubocop-ast (>= 1.38.0, < 2.0)
|
116
117
|
rubocop-rspec (3.5.0)
|
117
118
|
lint_roller (~> 1.1)
|
@@ -122,12 +123,13 @@ GEM
|
|
122
123
|
reline
|
123
124
|
runger_config (5.2.0)
|
124
125
|
activesupport (>= 7.1.2)
|
125
|
-
runger_release_assistant (
|
126
|
+
runger_release_assistant (4.3.1)
|
126
127
|
activesupport (>= 6)
|
127
128
|
memo_wise (>= 1.7)
|
128
129
|
rainbow (>= 3.0)
|
130
|
+
rake (>= 13.2.1)
|
129
131
|
slop (~> 4.8)
|
130
|
-
runger_style (5.
|
132
|
+
runger_style (5.8.1)
|
131
133
|
prism (>= 0.24.0)
|
132
134
|
rubocop (>= 1.72.0)
|
133
135
|
securerandom (0.4.1)
|
@@ -141,7 +143,7 @@ GEM
|
|
141
143
|
simplecov-html (0.13.1)
|
142
144
|
simplecov_json_formatter (0.1.4)
|
143
145
|
slop (4.10.1)
|
144
|
-
stringio (3.1.
|
146
|
+
stringio (3.1.6)
|
145
147
|
tzinfo (2.0.6)
|
146
148
|
concurrent-ruby (~> 1.0)
|
147
149
|
unicode-display_width (3.1.4)
|
@@ -170,7 +172,7 @@ DEPENDENCIES
|
|
170
172
|
|
171
173
|
CHECKSUMS
|
172
174
|
activesupport (8.0.2) sha256=8565cddba31b900cdc17682fd66ecd020441e3eef320a9930285394e8c07a45e
|
173
|
-
ast (2.4.
|
175
|
+
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
174
176
|
base64 (0.2.0) sha256=0f25e9b21a02a0cc0cea8ef92b2041035d39350946e8789c562b2d1a3da01507
|
175
177
|
benchmark (0.4.0) sha256=0f12f8c495545e3710c3e4f0480f63f06b4c842cc94cec7f33a956f5180e874a
|
176
178
|
bigdecimal (3.1.9) sha256=2ffc742031521ad69c2dfc815a98e426a230a3d22aeac1995826a75dabfad8cc
|
@@ -179,7 +181,7 @@ CHECKSUMS
|
|
179
181
|
concurrent-ruby (1.3.5) sha256=813b3e37aca6df2a21a3b9f1d497f8cbab24a2b94cab325bffe65ee0f6cbebc6
|
180
182
|
connection_pool (2.5.0) sha256=233b92f8d38e038c1349ccea65dd3772727d669d6d2e71f9897c8bf5cd53ebfc
|
181
183
|
date (3.4.1) sha256=bf268e14ef7158009bfeaec40b5fa3c7271906e88b196d958a89d4b408abe64f
|
182
|
-
diff-lcs (1.6.
|
184
|
+
diff-lcs (1.6.1) sha256=12a5a83f3e37a8e2f4427268e305914d5f1879f22b4e73bb1a09f76a3dd86cd4
|
183
185
|
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
|
184
186
|
drb (2.2.1) sha256=e9d472bf785f558b96b25358bae115646da0dbfd45107ad858b0bc0d935cb340
|
185
187
|
i18n (1.14.7) sha256=ceba573f8138ff2c0915427f1fc5bdf4aa3ab8ae88c8ce255eb3ecf0a11a5d0f
|
@@ -188,22 +190,22 @@ CHECKSUMS
|
|
188
190
|
json (2.10.2) sha256=34e0eada93022b2a0a3345bb0b5efddb6e9ff5be7c48e409cfb54ff8a36a8b06
|
189
191
|
language_server-protocol (3.17.0.4) sha256=c484626478664fd13482d8180947c50a8590484b1258b99b7aedb3b69df89669
|
190
192
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
191
|
-
logger (1.
|
193
|
+
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
192
194
|
memo_wise (1.11.0) sha256=06ef23a1edb6b8ee4f37d950bba04836b437b4d1036e45d24c2fd2f25b5490c3
|
193
195
|
method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
|
194
|
-
minitest (5.25.
|
196
|
+
minitest (5.25.5) sha256=391b6c6cb43a4802bfb7c93af1ebe2ac66a210293f4a3fb7db36f2fc7dc2c756
|
195
197
|
parallel (1.26.3) sha256=d86babb7a2b814be9f4b81587bf0b6ce2da7d45969fab24d8ae4bf2bb4d4c7ef
|
196
|
-
parser (3.3.7.
|
198
|
+
parser (3.3.7.4) sha256=2b26282274280e13f891080dc4ef3f65ce658d62e13255b246b28ec6754e98ab
|
197
199
|
pp (0.6.2) sha256=947ec3120c6f92195f8ee8aa25a7b2c5297bb106d83b41baa02983686577b6ff
|
198
200
|
prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
|
199
|
-
prism (1.
|
201
|
+
prism (1.4.0) sha256=dc0e3e00e93160213dc2a65519d9002a4a1e7b962db57d444cf1a71565bb703e
|
200
202
|
pry (0.15.2) sha256=12d54b8640d3fa29c9211dd4ffb08f3fd8bf7a4fd9b5a73ce5b59c8709385b6b
|
201
203
|
pry-byebug (3.10.1)
|
202
204
|
psych (5.2.3) sha256=84a54bb952d14604fea22d99938348814678782f58b12648fcdfa4d2fce859ee
|
203
205
|
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
204
206
|
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
205
207
|
rake (13.2.1) sha256=46cb38dae65d7d74b6020a4ac9d48afed8eb8149c040eccf0523bec91907059d
|
206
|
-
rdoc (6.
|
208
|
+
rdoc (6.13.1) sha256=62a0dac99493c94e8eb7a3fb44e55aefcb4cecb119f7991f25bddc5ed8d472f7
|
207
209
|
regexp_parser (2.10.0) sha256=cb6f0ddde88772cd64bff1dbbf68df66d376043fe2e66a9ef77fcb1b0c548c61
|
208
210
|
reline (0.6.0) sha256=57620375dcbe56ec09bac7192bfb7460c716bbf0054dc94345ecaa5438e539d2
|
209
211
|
rexml (3.4.1) sha256=c74527a9a0a04b4ec31dbe0dc4ed6004b960af943d8db42e539edde3a871abca
|
@@ -213,23 +215,23 @@ CHECKSUMS
|
|
213
215
|
rspec-expectations (3.13.3) sha256=0e6b5af59b900147698ea0ff80456c4f2e69cac4394fbd392fbd1ca561f66c58
|
214
216
|
rspec-mocks (3.13.2) sha256=2327335def0e1665325a9b617e3af9ae20272741d80ac550336309a7c59abdef
|
215
217
|
rspec-support (3.13.2) sha256=cea3a2463fd9b84b9dcc9685efd80ea701aa8f7b3decb3b3ce795ed67737dbec
|
216
|
-
rubocop (1.
|
217
|
-
rubocop-ast (1.
|
218
|
-
rubocop-performance (1.
|
218
|
+
rubocop (1.75.1) sha256=c12900c55b0b52e6ed1384f7f7575beb92047019ce37ca14b9572d80239adc29
|
219
|
+
rubocop-ast (1.44.0) sha256=77fdaf4aacf0c7d1ef887b075686124fb4ae5743d42ff7e73bb1c0d6b61b5d0a
|
220
|
+
rubocop-performance (1.25.0) sha256=6f7d03568a770054117a78d0a8e191cefeffb703b382871ca7743831b1a52ec1
|
219
221
|
rubocop-rspec (3.5.0) sha256=710c942fe1af884ba8eea75cbb8bdbb051929a2208880a6fc2e2dce1eed5304c
|
220
222
|
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
221
223
|
runger_byebug (11.4.0) sha256=569e22ba2215f57e7f69e145fcb63be401e29fcd312f7936d813e12d0c7bbee6
|
222
224
|
runger_config (5.2.0) sha256=9b76d767a2daa63f6f8f2c52a8183f3f09a877cd35bcaee692d25377f4dd4558
|
223
|
-
runger_release_assistant (
|
224
|
-
runger_style (5.
|
225
|
+
runger_release_assistant (4.3.1) sha256=3246c925240739eb12b9e6b9526a77ea00fcf0a0941441ff5ffacefb7e3e4d83
|
226
|
+
runger_style (5.8.1) sha256=e1748117818758bfd0f2cb038eff86171fca6237c34a723e8dd33882ed5da233
|
225
227
|
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
|
226
|
-
simple_cov-formatter-terminal (1.
|
228
|
+
simple_cov-formatter-terminal (1.9.0)
|
227
229
|
simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
|
228
230
|
simplecov-cobertura (2.1.0) sha256=2c6532e34df2e38a379d72cef9a05c3b16c64ce90566beebc6887801c4ad3f02
|
229
231
|
simplecov-html (0.13.1) sha256=5dab0b7ee612e60e9887ad57693832fdf4695b4c0c859eaea5f95c18791ef10b
|
230
232
|
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
|
231
233
|
slop (4.10.1) sha256=844322b5ffcf17ed4815fdb173b04a20dd82b4fd93e3744c88c8fafea696d9c7
|
232
|
-
stringio (3.1.
|
234
|
+
stringio (3.1.6) sha256=292c495d1657adfcdf0a32eecf12a60e6691317a500c3112ad3b2e31068274f5
|
233
235
|
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
|
234
236
|
unicode-display_width (3.1.4) sha256=8caf2af1c0f2f07ec89ef9e18c7d88c2790e217c482bfc78aaa65eadd5415ac1
|
235
237
|
unicode-emoji (4.0.4) sha256=2c2c4ef7f353e5809497126285a50b23056cc6e61b64433764a35eff6c36532a
|
data/README.md
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
* [Which lines to print](#which-lines-to-print)
|
10
10
|
* [Modifying the spec_to_app_file_map](#modifying-the-spec_to_app_file_map)
|
11
11
|
* [Manually specifying file for which to show coverage](#manually-specifying-file-for-which-to-show-coverage)
|
12
|
+
* [Manually specifying the lines for which to show coverage](#manually-specifying-the-lines-for-which-to-show-coverage)
|
12
13
|
* [Branch coverage](#branch-coverage)
|
13
14
|
* [Terminal hyperlinks](#terminal-hyperlinks)
|
14
15
|
* [Disabling](#disabling)
|
@@ -18,7 +19,7 @@
|
|
18
19
|
* [License](#license)
|
19
20
|
|
20
21
|
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
|
21
|
-
<!-- Added by: david, at:
|
22
|
+
<!-- Added by: david, at: Thu Apr 3 06:28:33 PM CDT 2025 -->
|
22
23
|
|
23
24
|
<!--te-->
|
24
25
|
|
@@ -128,6 +129,10 @@ SimpleCov::Formatter::Terminal.config.spec_to_app_file_map = {
|
|
128
129
|
|
129
130
|
An alternative to using the `spec_to_app_file_map` configuration is to set a `SIMPLECOV_TARGET_FILE` environment variable.
|
130
131
|
|
132
|
+
### Manually specifying the lines for which to show coverage
|
133
|
+
|
134
|
+
To show coverage only for certain lines, you can specify a range (or ranges) via a `SIMPLECOV_TERMINAL_LINES` environment variable, e.g. `SIMPLECOV_TERMINAL_LINES=169-172` or `SIMPLECOV_TERMINAL_LINES=172,180-192`.
|
135
|
+
|
131
136
|
## Branch coverage
|
132
137
|
|
133
138
|
If you enable branch coverage for SimpleCov (via `enable_coverage(:branch)` within your
|
@@ -20,8 +20,8 @@ module SimpleCov::Formatter::Terminal::BranchCoverage
|
|
20
20
|
|
21
21
|
def missed_branch_info(line, sourcefile)
|
22
22
|
uncovered_branches(sourcefile).
|
23
|
-
select {
|
24
|
-
map {
|
23
|
+
select { it.start_line == line.line_number }.
|
24
|
+
map { it.type.to_s }.
|
25
25
|
join(', ').
|
26
26
|
presence
|
27
27
|
end
|
@@ -32,7 +32,7 @@ module SimpleCov::Formatter::Terminal::RSpecIntegration
|
|
32
32
|
SimpleCov::Formatter::Terminal::RSpecIntegration.failure_occurred =
|
33
33
|
examples.any?(&:exception)
|
34
34
|
SimpleCov::Formatter::Terminal::RSpecIntegration.executed_spec_files =
|
35
|
-
examples.map {
|
35
|
+
examples.map { it.file_path.delete_prefix('./') }.uniq
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -17,7 +17,7 @@ class SimpleCov::Formatter::Terminal::ResultPrinter
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def print_coverage_info(result)
|
20
|
-
sourcefile = result.files.find {
|
20
|
+
sourcefile = result.files.find { it.filename.end_with?(targeted_application_file) }
|
21
21
|
force_coverage = ENV.fetch('SIMPLECOV_FORCE_DETAILS', nil) == '1'
|
22
22
|
|
23
23
|
if sourcefile.nil?
|
@@ -81,12 +81,17 @@ class SimpleCov::Formatter::Terminal::ResultPrinter
|
|
81
81
|
def print_skipped_lines(skipped_lines)
|
82
82
|
divider = ' -' * 40
|
83
83
|
|
84
|
+
# If we are skipping lines because they aren't in an env var specified
|
85
|
+
# range, they might or might not be covered. If we are skipping them
|
86
|
+
# otherwise, it's because they're covered.
|
87
|
+
skipped_lines_adjective = ENV.fetch('SIMPLECOV_TERMINAL_LINES', nil).present? ? '' : 'covered '
|
88
|
+
|
84
89
|
puts(line_printer.numbered_line_output(nil, :white, divider))
|
85
90
|
puts(
|
86
91
|
line_printer.numbered_line_output(
|
87
92
|
nil,
|
88
93
|
:white,
|
89
|
-
"#{skipped_lines.size}
|
94
|
+
"#{skipped_lines.size} #{skipped_lines_adjective}line(s) omitted".center(80, ' '),
|
90
95
|
),
|
91
96
|
)
|
92
97
|
puts(line_printer.numbered_line_output(nil, :white, divider))
|
@@ -158,46 +163,51 @@ class SimpleCov::Formatter::Terminal::ResultPrinter
|
|
158
163
|
end
|
159
164
|
|
160
165
|
def sourcefile
|
161
|
-
@sourcefile ||= @result.files.find {
|
166
|
+
@sourcefile ||= @result.files.find { it.filename.end_with?(targeted_application_file) }
|
162
167
|
end
|
163
168
|
|
164
|
-
# rubocop:disable Metrics/PerceivedComplexity
|
165
169
|
memo_wise \
|
166
170
|
def line_numbers_to_print
|
167
171
|
max_line_number = sourcefile.lines.map(&:line_number).max
|
168
172
|
|
169
173
|
begin
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
174
|
+
if (env_var_line_ranges = ENV.fetch('SIMPLECOV_TERMINAL_LINES', nil)).present?
|
175
|
+
env_var_line_ranges.split(',').reduce([]) do |total_lines, env_var_line_range|
|
176
|
+
lines_start, lines_end = env_var_line_range.split('-').map { Integer(it) }
|
177
|
+
total_lines + (lines_start..(lines_end || lines_start)).to_a
|
178
|
+
end
|
179
|
+
else
|
180
|
+
case SimpleCov::Formatter::Terminal.config.lines_to_print.to_sym
|
181
|
+
in SimpleCov::Formatter::Terminal::Config::LinesToPrint::ALL
|
182
|
+
(1..max_line_number).to_a
|
183
|
+
in SimpleCov::Formatter::Terminal::Config::LinesToPrint::UNCOVERED
|
184
|
+
line_numbers_to_print = []
|
185
|
+
|
186
|
+
sourcefile.lines.each do |line|
|
187
|
+
if (
|
188
|
+
line.coverage.nil? || (
|
189
|
+
(line.coverage > 0) &&
|
190
|
+
!line_numbers_with_missing_branches(sourcefile).include?(line.line_number)
|
191
|
+
)
|
181
192
|
)
|
182
|
-
|
183
|
-
|
193
|
+
next
|
194
|
+
end
|
195
|
+
|
196
|
+
line_number = line.line_number
|
197
|
+
contextualized_line_numbers =
|
198
|
+
((line_number - 2)..(line_number + 2)).
|
199
|
+
to_a.
|
200
|
+
select do |context_line_number|
|
201
|
+
context_line_number.positive? && context_line_number <= max_line_number
|
202
|
+
end
|
203
|
+
line_numbers_to_print += contextualized_line_numbers
|
184
204
|
end
|
185
205
|
|
186
|
-
|
187
|
-
contextualized_line_numbers =
|
188
|
-
((line_number - 2)..(line_number + 2)).
|
189
|
-
to_a.
|
190
|
-
select do |context_line_number|
|
191
|
-
context_line_number.positive? && context_line_number <= max_line_number
|
192
|
-
end
|
193
|
-
line_numbers_to_print += contextualized_line_numbers
|
206
|
+
line_numbers_to_print
|
194
207
|
end
|
195
|
-
|
196
|
-
line_numbers_to_print
|
197
208
|
end
|
198
209
|
end.to_set
|
199
210
|
end
|
200
|
-
# rubocop:enable Metrics/PerceivedComplexity
|
201
211
|
|
202
212
|
memo_wise \
|
203
213
|
def line_printer
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_cov-formatter-terminal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Runger
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03
|
10
|
+
date: 2025-04-03 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activesupport
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
rubygems_version: 3.6.
|
148
|
+
rubygems_version: 3.6.6
|
149
149
|
specification_version: 4
|
150
150
|
summary: Print detailed code coverage info to the terminal
|
151
151
|
test_files: []
|