Conversation
The number of lines in a file is usually computed at the number of newlines in the file minus 1, as described [here](https://codereview.stackexchange.com/questions/131143/counting-newlines-in-a-file). I also confirmed this by running `wc` on linux with a file that is: * empty * non-empty but with no newlines * with newlines and no trailing newline * with newlines and with a trailing newline I noticed this when I saw that the number of lines reported in the file list on coveralls didn't match the number of lines actually in the file.
|
Since this library doesn't seem to be supported anymore I fix a bunch of things on a fork if you want to check it out and are still pulling the library into your packages: https://github.com/jtwebman/coveralls-next I would be willing to pull this change in. |
|
I'm using the coveralls github action mostly: https://github.com/marketplace/actions/coveralls-github-action . You should take this change, though, because it makes the code more correct. |
|
Good call though your change here was in the wrong place. The |
|
Now that I look at the change though and test it out on that project it could be dangerous as people could set up their project to not leave a blank line on the end. If that line has no code then it will not be counted for code coverage. So the safe bet is to keep it as if there was code on those lines this code will error as the LCOV format could have a line with those values. |
Like I wrote above, I tested it against But what makes sense for coveralls and what works for wc might be different. Ah well. |
The number of lines in a file is usually computed at the number of newlines in the file minus 1, as described here. I also confirmed this by running
wcon linux with a file that is:I noticed this when I saw that the number of lines reported in the file list on coveralls didn't match the number of lines actually in the file.