Closed will closed 2 years ago
Hi @will 👋
These values should be straight from the ruby Coverage module, and are documented there: https://devdocs.io/ruby~3.1/coverage
Thank you! I didn’t think of checking in the ruby side hah
@colszowka thanks again! it's so handy to know exactly what conditional is missing in coverage when there can be more than one conditional per line
@will just as additional information, resultset.json
is not part of the public API and should not be relied on. Furthermore, it is missing certain features of SimpleCov (filtering, adding files etc is done post resultset.json). We now include a JSON formatter. I recommend using it instead.
@PragTob I poked a bit at that, but it seems like it doesn't work with rpsec 3?
Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected
/Users/will/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/formatters/deprecation_formatter.rb:186:in 'puts': The SimpleCovJSONFormatter formatter uses the deprecated formatter interface not supported directly by RSpec 3. To continue to use this formatter you must install the rspec-legacy_formatters
gem, which provides support for legacy formatters or upgrade the formatter to a compatible version. Formatter added at: /Users/will/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/exe/rspec:4:in `<top (required)>' (RSpec::Core::DeprecationError)
I could do what it says and try that legacy formatters gem, but the name makes me think that is not a long term solution either
I'm toying with the idea of adding a way to see coverage in the neovim gutter instead of having to open up the html report. I figure the best way would be to read the json file.
It seems like the array of
line
s is how many times that line is hit, and so anything that is 0 would be not covered. I don’t understand thenull
values though. Not tracked at all maybe?The branches though is a big mystery to me:
Can you please shed some light on what all these numbers mean? I've poked around the souce code a bit, but couldn't figure it out, so hoping it's not too noisy opening this issue to ask.