Skip to content
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

Add option to include TOTAL line even if there's only one file #1086

Closed
lordjabez opened this issue Jan 3, 2021 · 6 comments
Closed

Add option to include TOTAL line even if there's only one file #1086

lordjabez opened this issue Jan 3, 2021 · 6 comments
Labels
enhancement New feature or request fixed
Milestone

Comments

@lordjabez
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently the total line is skipped when there's only one file whose coverage was computed. This is annoying when using a regex to report on coverage from a CI/CD build log (e.g. in Gitlab) because one can't use the recommended regex.

Describe the solution you'd like
Either always print the TOTAL line, or add an option to force it even when there's only one file.

@lordjabez lordjabez added the enhancement New feature or request label Jan 3, 2021
@nedbat
Copy link
Owner

nedbat commented Jan 4, 2021

This has been requested before (#732, #922). I think my mind has changed, and we can go ahead and add an option for this.

@nedbat nedbat added this to the 5.next milestone Jan 4, 2021
@lordjabez
Copy link
Contributor Author

@nedbat I'd be happy to take a crack at coding it up. Do you have a preference on the option name? --always-show-total ? --show-total ? Something else?

@nedbat
Copy link
Owner

nedbat commented Jan 4, 2021

Thanks. I would name it --always-total. Don't forget the .coveragerc option.

lordjabez added a commit to lordjabez/coveragepy that referenced this issue Jan 4, 2021
lordjabez added a commit to lordjabez/coveragepy that referenced this issue Jan 4, 2021
@nedbat
Copy link
Owner

nedbat commented Jan 4, 2021

I hope this doesn't sound aggravating, but maybe the better path here is to just always output the total line, without an option.

@lordjabez
Copy link
Contributor Author

Not aggravating at all, I'm more than happy to go with a simpler solution.

I'll submit a new PR (and make sure all the tests still pass).

@lordjabez lordjabez reopened this Jan 4, 2021
@nedbat
Copy link
Owner

nedbat commented Jan 26, 2021

This is now released as part of coverage 5.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants