grodowski / undercover

undercover warns about methods, classes and blocks that were changed without tests, to help you easily find untested code and reduce the number of bugs. It does so by analysing data from git diffs, code structure and SimpleCov coverage reports
https://undercover-ci.com
MIT License
724 stars 28 forks source link

Minor: Do not raise on malformed lcov #192

Closed ylecuyer closed 9 months ago

ylecuyer commented 1 year ago

I'm working on adding js coverage to our codebase, the lcov provided by nyc is valid though undercover raises as if it was invalid.

lcov format is more than just SF/DA/BRF/BRH/BRDA/end_of_record, in nyc lcov for example there is: TN/FN/FNF/FNH/FNDA/LF/LH

I think it would be better to just skip unknown lines instead of raising, I wanted to add some log but there is no logger facility in the project atm.

grodowski commented 1 year ago

Heyy @ylecuyer and thanks for opening the PR.

I'm working on adding js coverage to our codebase, the lcov provided by nyc is valid though undercover raises as if it was invalid.

Does this imply adding JS support to undercover? LcovParser was only tested and built based on simplecov-lcov output for Ruby, including branch coverage. It doesn't capture functions or blocks, so that's custom-built into undercover by parsing the code structure using parser and imagen-rb.