-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code coverage is adding extra lines that are not part of the diff #15
Comments
Hi! I'm glad you found my creation useful and want to use it in your project 😄
This is possible with Undercover and the answer may be hidden in what's provided by Moving to this gem, it has to conform to the Please tell me if that makes sense and let's discuss further! I am welcoming contributions to this and other undercover gems |
I think in that case undercover should have an option which can be passed where I can specify if I need |
Hi Jan,
First of all thanks for this gem, I was just trying to integrate it in my private repo to improve code coverage.
While pronto-undercover works well for new files it is causing some issues when some code is added to existing method.
The runner lists few extra lines that are not part of the diff.
I tried to do some research and found out that when
patch_to_undercover_message(patch)
is called it callsoffending_line_numbers
per patch which internally calculates uncovered lines and returns first line of that uncovered patch.Then in the loop of the object returned by method call
offending_line_numbers(patch)
we are again checking uncovered lines but this time the uncovered lines returned are simply all the lines from first and last line of that particular patch. I can see that undercover'scoverage
method is called for this. This seems unnecessary and incorrect, as the correct line numbers (which are only part of the diff) can be returned usingoffending_line_numbers(patch)
this call which can instead of returning[warning, first_line_no]
return[warning, uncovered_lines]
and which further can be used to prepare the output.Let me know if you wan't to discuss this.
The text was updated successfully, but these errors were encountered: