parroty / excoveralls

Coverage report tool for Elixir with coveralls.io integration.
MIT License
821 stars 178 forks source link

Add option for filtering out full covered files from HTML report #268

Closed albertored closed 2 years ago

albertored commented 2 years ago

I find it useful to focus on files not fully covered so I added an option for HTML reports that allows hiding all fully covered files.

This is only a proposal and some open points/missing things remain to be done but I would like to know your opinion before actually implement all of them.

I know that I can copy the eex template on my repo and add the needed if clause to obtain this behavior but I think this can be useful to other people.

Open points

parroty commented 2 years ago

Thank you for the suggestion. The filtering option might be beneficial if it can be switched (as optional). But I'm not confident enough yet, and may need to check the behavior a little more.

kerryb commented 2 years ago

This would be a very welcome feature. I have a project with a lot of modules, and it can be hard to spot the ones with missing coverage in either the HTML or terminal output.

albertored commented 2 years ago

Hi @parroty, did you have time to think about this PR?

parroty commented 2 years ago

Thank you for the follow-up, and sorry for not being responsive. I think I previously couldn't make the tests pass. Is it possible for you to re-push the changes to run the actions workflow? (I cannot see a re-run option from my end. It could be the previous run was too old).

parroty commented 2 years ago

Thank you for the PR. One request would be, is it possible to add a brief description for the option (html_filter_full_covered) in the README? Assuming this doesn't break existing behavior (as an optional behavior), I would merge the change once tests pass.

albertored commented 2 years ago

@parroty done

coveralls commented 2 years ago

Coverage Status

Coverage increased (+3.5%) to 90.43% when pulling 6482d8e0e4cc4a3d80a3cd7ab03cb28224fa8b8a on albertored:html-filter-full-covered into a716e6e66aae64f4dc9d6d29859c47959151b229 on parroty:master.

parroty commented 2 years ago

Thanks for the quick update. The test failed on the size check part as the HTML layout has changed. Could you update the corresponding test part too?

     stacktrace:
diff --git a/test/html_test.exs b/test/html_test.exs
index 73c8dda..bb29e3f 100644
--- a/test/html_test.exs
+++ b/test/html_test.exs
@@ -5,7 +5,7 @@ defmodule ExCoveralls.HtmlTest do
   alias ExCoveralls.Html

   @file_name "excoveralls.html"
-  @file_size 20191
+  @file_size 20375
   @test_output_dir "cover_test/"
   @test_template_path "lib/templates/html/htmlcov/"
albertored commented 2 years ago

Oh sorry, I didn't see that error, now it should be ok

parroty commented 2 years ago

Thanks!