Repository navigation
Adds option to track uncovered source files. - #422
xaviershay merged 2 commits into
Conversation
|
Looks like this is just about ready - a typo remains. I'm not sure whether the discussion about |
|
I'll apply the suggestion to mark the whole file as uncovered, instead of having a function to validate the lines (and fix the typo). |
Added a configuration option `track_files` that accepts
a glob. With this enabled, coverage result will include
uncovered files that match the glob.
In the `rails` profile this is set to `{app,lib}/**/*.rb`
b48311f to
81e2431
Compare
|
The builds are failing due to unrelated issues which are fixed in #425, by @xaviershay. |
|
Added some method documentation and merged. Thank you! I'll include this in 0.11. |
0.11.0 2015-11-29 ([changes](simplecov-ruby/simplecov@v0.10.0...v0.10.11)) ================= ## Enhancements * Added `SimpleCov.minimum_coverage_by_file` for per-file coverage thresholds. See [#392](simplecov-ruby/simplecov#392) (thanks @ptashman) * Added `track_files` configuration option to specify a glob to always include in coverage results, whether or not those files are required. See [#422](simplecov-ruby/simplecov#422) (thanks @hugopeixoto) * Speed up `root_filter` by an order of magnitude. See [#396](simplecov-ruby/simplecov#396) (thanks @raszi) ## Bugfixes * Fix warning about global variable `$ERROR_INFO`. See [#400](simplecov-ruby/simplecov#400) (thanks @amatsuda) * Actually recurse upward looking for `.simplecov`, as claimed by the documentation, rather than only the working directory. See [#423](simplecov-ruby/simplecov#423) (thanks @alexdowad)
|
This seems a really useful feature for finding unused code – worth highlighting in the README? |
|
Hi @andyw8
|
|
@ClaudioCarmeli I think he meant because it finds even files that aren't even required --> those can probably be deleted or something in the setup is wrong/incomplete |
|
Yes, that's what I was thinking of. |
0.11.0 2015-11-29 ([changes](simplecov-ruby/simplecov@v0.10.0...v0.10.11)) ================= ## Enhancements * Added `SimpleCov.minimum_coverage_by_file` for per-file coverage thresholds. See [#392](simplecov-ruby/simplecov#392) (thanks @ptashman) * Added `track_files` configuration option to specify a glob to always include in coverage results, whether or not those files are required. See [#422](simplecov-ruby/simplecov#422) (thanks @hugopeixoto) * Speed up `root_filter` by an order of magnitude. See [#396](simplecov-ruby/simplecov#396) (thanks @raszi) ## Bugfixes * Fix warning about global variable `$ERROR_INFO`. See [#400](simplecov-ruby/simplecov#400) (thanks @amatsuda) * Actually recurse upward looking for `.simplecov`, as claimed by the documentation, rather than only the working directory. See [#423](simplecov-ruby/simplecov#423) (thanks @alexdowad)
0.11.0 2015-11-29 ([changes](simplecov-ruby/simplecov@v0.10.0...v0.10.11)) ================= ## Enhancements * Added `SimpleCov.minimum_coverage_by_file` for per-file coverage thresholds. See [#392](simplecov-ruby/simplecov#392) (thanks @ptashman) * Added `track_files` configuration option to specify a glob to always include in coverage results, whether or not those files are required. See [#422](simplecov-ruby/simplecov#422) (thanks @hugopeixoto) * Speed up `root_filter` by an order of magnitude. See [#396](simplecov-ruby/simplecov#396) (thanks @raszi) ## Bugfixes * Fix warning about global variable `$ERROR_INFO`. See [#400](simplecov-ruby/simplecov#400) (thanks @amatsuda) * Actually recurse upward looking for `.simplecov`, as claimed by the documentation, rather than only the working directory. See [#423](simplecov-ruby/simplecov#423) (thanks @alexdowad)
Fixes #413
Added a configuration option
track_filesthat acceptsa glob. With this enabled, coverage result will include
uncovered files that match the glob.
In the
railsprofile this is set to{app,lib}/**/*.rbRegarding line count issue:
It is not easy to determine which lines should be classified as relevant (this is done by the ruby parser), so this implementation does not touch the coverage information for covered files, to avoid ruining the accurate percentages.
When handling uncovered files it uses an approximation function to determine if the line is relevant or not, based on the code present in #16. As uncovered files have 0% coverage, this will only affect the global percentage, so I don't think it's an issue.