-
Notifications
You must be signed in to change notification settings - Fork 389
Total coverage no longer easily regexable #284
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
Comments
With this regex I am not that used to regex. Is it possible with regex to remove the Line value from the string? |
GitLab's coverage regex will use a capture group, if present. So in this case, I can capture total branch coverage with the following regex: The point is, the output was originally added with an implicit requirement to be easily parsable. What used to be a simple and straightforward regex has become an ugly mess. Maybe we can add a switch for output format: table vs flat? |
Then I think the switch would be the appropriate solution. For humans this table view might quite appealing. But for parsing the simpe text output is perfekt |
The problem on your solution is that it dont works if you have full percent values. This works: This dont works: |
@desmondgc If you want to use it, test it here: Sample Values: +---------+-------+--------+--------+ |
| ?Total +| +(\d+.\d+|\d+)% |
None of the above regex did the trick for me. What actually helped |
In my case, what separates the decimals from integers is a comma, so What actually helped me si |
Close for stale, related feature issue to avoid regex usage #542 |
In coverlet.msbuild v2.4.0, the total coverage output looks like this:
This functionality was added in #180 to support coverage badges in CI systems. In our GitLab config I can easily report on total branch coverage using the following:
coverage: '/^Total Branch: \d+\.\d+/'
With the changes introduced in #271 / coverlet.msbuild v2.5.0, the output now looks like this:
This output format is much harder to work with. Can we eliminate the table?
The text was updated successfully, but these errors were encountered: