Skip to content

Commit 55b54d2

Browse files
committed
Merge simplecov-html into simplecov
The HTML formatter is no longer a separate gem. All source code, ERB templates, compiled assets, frontend build tooling, and tests from simplecov-ruby/simplecov-html have been absorbed into this repository. A backward-compatibility shim at lib/simplecov-html.rb ensures that `require "simplecov-html"` continues to work for existing users.
1 parent 23cf4bb commit 55b54d2

83 files changed

Lines changed: 5529 additions & 231 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ tmp
2424
.rvmrc
2525

2626
## PROJECT::SPECIFIC
27+
html_frontend/node_modules
2728

2829
.yardoc
2930
spec/fixtures/coverage

.rubocop.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ Lint/ConstantDefinitionInBlock:
7171
Exclude:
7272
- "spec/**/*_spec.rb"
7373

74+
Lint/Void:
75+
Exclude:
76+
- "test/html_formatter/fixtures/**/*"
77+
7478
Lint/DeprecatedConstants:
7579
Enabled: true
7680

@@ -167,6 +171,7 @@ Metrics/BlockLength:
167171
Description: Checks if the length of a block exceeds some maximum value.
168172
Exclude:
169173
- "spec/**/*.rb"
174+
- "features/step_definitions/**/*.rb"
170175

171176
Metrics/BlockNesting:
172177
Description: Avoid excessive block nesting.
@@ -175,6 +180,8 @@ Metrics/BlockNesting:
175180

176181
Metrics/ClassLength:
177182
Max: 300
183+
Exclude:
184+
- "test/**/*.rb"
178185

179186
Metrics/MethodLength:
180187
Description: Checks if the length of a method exceeds some maximum value.
@@ -190,13 +197,15 @@ Metrics/ModuleLength:
190197
Metrics/ParameterLists:
191198
Description: Avoid parameter lists longer than three or four parameters.
192199
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#too-many-params
193-
Max: 4
200+
Max: 5
194201
CountKeywordArgs: true
195202

196203
Naming/FileName:
197204
Description: makes sure that Ruby source files have snake_case names.
198205
Exclude:
199206
- "spec/fixtures/utf-8.rb"
207+
- "lib/simplecov-html.rb"
208+
- "test/html_formatter/test_simple_cov-html.rb"
200209

201210
Style/AccessorGrouping:
202211
Enabled: true
@@ -258,6 +267,7 @@ Style/FrozenStringLiteralComment:
258267
EnforcedStyle: always
259268
Exclude:
260269
- "spec/fixtures/**/*"
270+
- "test/html_formatter/fixtures/**/*"
261271

262272
Style/GlobalStdStream:
263273
Enabled: true

Gemfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22

33
source "https://rubygems.org"
44

5-
# Uncomment this to use local copy of simplecov-html in development when checked out
6-
# gem "simplecov-html", path: File.join(__dir__, "../simplecov-html")
7-
8-
# Uncomment this to use development version of html formatter from github
9-
# gem "simplecov-html", github: "simplecov-ruby/simplecov-html"
10-
115
group :development do
6+
gem "nokogiri"
127
gem "cuprite"
138
gem "aruba"
149
gem "capybara"

Gemfile.lock

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ PATH
33
specs:
44
simplecov (0.22.0)
55
docile (~> 1.1)
6-
simplecov-html (~> 0.12)
76
simplecov_json_formatter (~> 0.1)
87

98
GEM
@@ -136,7 +135,6 @@ GEM
136135
parser (>= 3.3.7.2)
137136
prism (~> 1.7)
138137
ruby-progressbar (1.13.0)
139-
simplecov-html (0.13.2)
140138
simplecov_json_formatter (0.1.4)
141139
sys-uname (1.5.1)
142140
ffi (~> 1.1)
@@ -171,6 +169,7 @@ DEPENDENCIES
171169
cucumber
172170
cuprite
173171
minitest
172+
nokogiri
174173
rackup
175174
rake
176175
rspec

Rakefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,12 @@ Cucumber::Rake::Task.new do |t|
2929
t.cucumber_opts = %w[--retry 3 --no-strict-flaky]
3030
end
3131

32-
task test: %i[spec cucumber]
33-
task default: %i[rubocop spec cucumber]
32+
require "rake/testtask"
33+
Rake::TestTask.new(:test_html) do |t|
34+
t.libs << "test/html_formatter"
35+
t.pattern = "test/html_formatter/**/test_*.rb"
36+
t.verbose = true
37+
end
38+
39+
task test: %i[spec cucumber test_html]
40+
task default: %i[rubocop spec cucumber test_html]

features/branch_coverage.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ Feature:
1717
When I open the coverage report generated with `bundle exec rspec spec`
1818
Then I should see the groups:
1919
| name | coverage | files |
20-
| All Files | 91.8% | 7 |
20+
| All Files | 91.80% | 7 |
2121
And I should see a line coverage summary of 56/61
2222
And I should see a branch coverage summary of 2/4
2323
And I should see the source files:
2424
| name | coverage | branch coverage |
25-
| lib/faked_project.rb | 100.00 % | 100.00 % |
26-
| lib/faked_project/some_class.rb | 80.00 % | 50.00 % |
27-
| lib/faked_project/framework_specific.rb | 75.00 % | 100.00 % |
28-
| lib/faked_project/meta_magic.rb | 100.00 % | 100.00 % |
29-
| spec/forking_spec.rb | 100.00 % | 50.00 % |
30-
| spec/meta_magic_spec.rb | 100.00 % | 100.00 % |
31-
| spec/some_class_spec.rb | 100.00 % | 100.00 % |
25+
| lib/faked_project.rb | 100.00% | 100.00% |
26+
| lib/faked_project/some_class.rb | 80.00% | 50.00% |
27+
| lib/faked_project/framework_specific.rb | 75.00% | 100.00% |
28+
| lib/faked_project/meta_magic.rb | 100.00% | 100.00% |
29+
| spec/forking_spec.rb | 100.00% | 50.00% |
30+
| spec/meta_magic_spec.rb | 100.00% | 100.00% |
31+
| spec/some_class_spec.rb | 100.00% | 100.00% |
3232

3333
When I open the detailed view for "lib/faked_project/some_class.rb"
3434
Then I should see a line coverage summary of 12/15 for the file

features/config_autoload.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ Feature:
3939

4040
And I should see the groups:
4141
| name | coverage | files |
42-
| All Files | 90.48% | 4 |
42+
| All Files | 90.47% | 4 |
4343

4444
And I should see the source files:
4545
| name | coverage |
46-
| lib/faked_project.rb | 100.00 % |
47-
| lib/faked_project/some_class.rb | 80.00 % |
48-
| lib/faked_project/framework_specific.rb | 87.50 % |
49-
| lib/faked_project/meta_magic.rb | 100.00 % |
46+
| lib/faked_project.rb | 100.00% |
47+
| lib/faked_project/some_class.rb | 80.00% |
48+
| lib/faked_project/framework_specific.rb | 87.50% |
49+
| lib/faked_project/meta_magic.rb | 100.00% |

features/config_enable_for_subprocesses.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Feature:
1010
When I open the coverage report generated with `bundle exec rspec spec/simple_spec.rb`
1111
Then I should see the groups:
1212
| name | coverage | files |
13-
| All Files | 100.0% | 1 |
13+
| All Files | 100.00% | 1 |
1414

1515
Scenario: The at_fork proc
1616
Given a file named ".simplecov" with:
@@ -25,7 +25,7 @@ Feature:
2525
When I open the coverage report generated with `bundle exec rspec spec/simple_spec.rb`
2626
Then I should see the groups:
2727
| name | coverage | files |
28-
| All Files | 100.0% | 1 |
28+
| All Files | 100.00% | 1 |
2929
And the report should be based upon:
3030
| child process name |
3131
| parent process name |
@@ -34,4 +34,4 @@ Feature:
3434
When I open the coverage report generated with `bundle exec rspec spec/spawn_spec.rb`
3535
Then I should see the groups:
3636
| name | coverage | files |
37-
| All Files | 100.0% | 1 |
37+
| All Files | 100.00% | 1 |

features/config_nocov_token.feature

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ Feature:
3333

3434
Then I should see the source files:
3535
| name | coverage |
36-
| lib/faked_project.rb | 100.00 % |
37-
| lib/faked_project/some_class.rb | 80.00 % |
38-
| lib/faked_project/framework_specific.rb | 75.00 % |
39-
| lib/faked_project/meta_magic.rb | 100.00 % |
40-
| lib/faked_project/nocov.rb | 100.00 % |
36+
| lib/faked_project.rb | 100.00% |
37+
| lib/faked_project/some_class.rb | 80.00% |
38+
| lib/faked_project/framework_specific.rb | 75.00% |
39+
| lib/faked_project/meta_magic.rb | 100.00% |
40+
| lib/faked_project/nocov.rb | 100.00% |
4141

4242
And there should be 7 skipped lines in the source files
4343

@@ -70,11 +70,11 @@ Feature:
7070

7171
Then I should see the source files:
7272
| name | coverage |
73-
| lib/faked_project.rb | 100.00 % |
74-
| lib/faked_project/some_class.rb | 80.00 % |
75-
| lib/faked_project/framework_specific.rb | 75.00 % |
76-
| lib/faked_project/meta_magic.rb | 100.00 % |
77-
| lib/faked_project/nocov.rb | 100.00 % |
73+
| lib/faked_project.rb | 100.00% |
74+
| lib/faked_project/some_class.rb | 80.00% |
75+
| lib/faked_project/framework_specific.rb | 75.00% |
76+
| lib/faked_project/meta_magic.rb | 100.00% |
77+
| lib/faked_project/nocov.rb | 100.00% |
7878

7979
And there should be 7 skipped lines in the source files
8080

features/config_profiles.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Feature:
2626
"""
2727

2828
When I open the coverage report generated with `bundle exec rake test`
29-
Then I should see "4 files in total."
29+
Then I should see "4 files"
3030
And I should see "using Profile Command" within "#footer"
3131

3232
Scenario: Using existing profile in custom profile and supplying profile to start command
@@ -41,5 +41,5 @@ Feature:
4141
"""
4242

4343
When I open the coverage report generated with `bundle exec rake test`
44-
Then I should see "4 files in total."
44+
Then I should see "4 files"
4545
And I should see "using My Profile" within "#footer"

0 commit comments

Comments
 (0)