-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix a corner case for blank metric #580
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your test is a lucky case where this works, but it doesn't work in general. I think you actually have to subtract lines that are both ploc and cloc only once.
For example, try removing the blank line in python_negative_blank (the result is "blank == 2", while it should be 0). Or, add another comment at the end of another source line (again, the result is "blank == 2", while it should still be 1).
It should be fixed now |
Can you test cases like:
|
b6e7319
to
9869865
Compare
Done |
Can you run the minimal tests script to see the difference before/after your patch on m-c? There might be cases we haven't thought of. |
9b0108a
to
fad4836
Compare
I can see only improvements and I can't find any additional useful test, have a loot at it also, perhaps I've lost something important https://community-tc.services.mozilla.com/api/queue/v1/task/MIBNQ1TgTlaK_x2yDtPw_g/runs/0/artifacts/public%2Fjson-diffs-and-minimal-tests.tar.gz |
@Luni-4 looks good to me. Can you remove the test commit? |
This PR fixes blank metric when there are code lines and comments on the same line. Before of this PR, those kinds of lines were counted twice.