Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

Add method coverage support - #110

Closed
tycooon wants to merge 17 commits into
simplecov-ruby:mainfrom
umbrellio:add-method-coverage-support
Closed

tycooon wants to merge 17 commits into
simplecov-ruby:mainfrom
umbrellio:add-method-coverage-support

Conversation

@tycooon

@tycooon tycooon commented Apr 23, 2021 •

Copy link
Copy Markdown
Contributor

See simplecov-ruby/simplecov#987.

Main page header view:

Screen Shot 2021-04-23 at 20 57 06

Main page table view:

Screen Shot 2021-04-23 at 20 57 31

Single file header view:

Screen Shot 2021-04-23 at 20 57 17

@tycooon

tycooon commented Apr 23, 2021

Copy link
Copy Markdown
Contributor Author

Also replaced travis with GH actions.

@tycooon
tycooon force-pushed the add-method-coverage-support branch from 5cfa3a9 to 149d1db Compare January 7, 2023 10:38

@pboling pboling left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though IMO dropping Ruby 2.4 and 2.5 will incur a major version bump. I think that's fine, just calling it out!

@rodrigoargumedo

Copy link
Copy Markdown

This looks fantastic changes to me and good additions for us as testers.

@sferik
sferik force-pushed the main branch 4 times, most recently from bb93130 to 7c47de8 Compare March 27, 2026 22:13
@sferik

sferik commented Mar 29, 2026

Copy link
Copy Markdown
Collaborator

@tycooon This branch needs to be rebased to resolve conflicts and adapted to simplecov-ruby/simplecov#1161.

I believe the main changes are replacing source_file.total_methods.count with source_file.methods.count in the two places that it occurs:

--- a/views/file_list.erb
+++ b/views/file_list.erb
@@ -87,7 +87,7 @@
             <% end %>
             <% if method_coverage? %>
               <td class="<%= coverage_css_class(source_file.methods_coverage_percent) %> strong cell--number t-file__method-coverage"><%= sprintf("%.2f", source_file.methods_coverage_percent.round(2)) %> %</td>
-              <td class="cell--number"><%= source_file.total_methods.count %></td>
+              <td class="cell--number"><%= source_file.methods.count %></td>
               <td class="cell--number"><%= source_file.covered_methods.count %></td>
               <td class="cell--number"><%= source_file.missed_methods.count %></td>
             <% end %>
--- a/views/source_file.erb
+++ b/views/source_file.erb
@@ -37,7 +37,7 @@

     <% if method_coverage? %>
       <div class="t-method-summary">
-          <span><b><%= source_file.total_methods.count %></b> total methods, </span>
+          <span><b><%= source_file.methods.count %></b> total methods, </span>
           <span class="green"><b><%= source_file.covered_methods.count %></b> methods covered</span> and
           <span class="red"><b><%= source_file.missed_methods.count %></b> methods missed.</span>
       </div>

Do you want to make these changes in this PR or do you want me to create a new PR? You could also enable “Allow edits from maintainers” on this PR, so I can push to your fork. Your branch has several commits that heavily conflict with main's current state. Instead of doing a commit-by-commit rebase, it might be easier to create a fresh branch from main with a single clean commit containing just the method coverage feature changes.

@tycooon

tycooon commented Mar 29, 2026

Copy link
Copy Markdown
Contributor Author

Hey @sferik, feel free to make a new PR! Closing this now.

@tycooon tycooon closed this Mar 29, 2026
@sferik

sferik commented Mar 29, 2026

Copy link
Copy Markdown
Collaborator

@tycooon Thanks so much for your work on this. The PR I merged was 99% your work with just a little bit of cleanup on my end.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants