Simplecov: Error: uneven number of nocov comments detected

Created on 29 Jan 2020  路  4Comments  路  Source: simplecov-ruby/simplecov

In versions prior to 0.18 we could add the # :nocov: comment at the beginning of files, without providing a closing tag, to ignore the entire file.

In version 0.18 this errors with uneven number of nocov comments detected followed by what seems to be an uncaught exception:

simplecov-0.18.0/lib/simplecov/source_file.rb:186:in `block in process_skipped_lines': undefined method `-' for nil:NilClass (NoMethodError)

Was the ability to ignore the whole file using just a single # :nocov: removed, or is this a bug?
I did not spot anything to that effect in the changelog.

Bug

Most helpful comment

Happy testing & measuring!

Thank you for the super quick turnaround. It was a real pleasure watching how the pros work.

All 4 comments

@DannyBen :wave:

Thanks for the bug report! :green_heart:

It wasn't intentionally removed, what happened was that the way nocov are calculated was changed so that they can also more easily used for branch coverage and that the same data could be reused for nocov.

I didn't know that it was possible to use it like this (makes sense though).

I'm somewhat certain that I can fix it relatively easily.

Thank you!
Tobi

I'm somewhat certain that I can fix it relatively easily.

Excellent. Although it is not a big deal, I sort of got used to this feature, saying ":nocov: from here until the next :nocov: or EOF"

Released in 0.18.1

Happy testing & measuring!

Happy testing & measuring!

Thank you for the super quick turnaround. It was a real pleasure watching how the pros work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jpatokal picture jpatokal  路  8Comments

MichaelHoste picture MichaelHoste  路  5Comments

juanbrein picture juanbrein  路  4Comments

jonbcampos picture jonbcampos  路  7Comments

cvandermeer picture cvandermeer  路  4Comments