Change --omit-covered from 100% coverage to --fail-under value
Hey, I just made a Pull Request!
Description
Change --omit-covered from 100% coverage to --fail-under value
Motivation and Context
--omit-covered currently only hides 100% covered files even when --fail-under sets another value
Have you tested this? If so, how?
Ran interrogate with the changes and they seem to work.
Checklist for PR author(s)
- [x] Changes are covered by unit tests (no major decrease in code coverage %).
- [ ] All tests pass. No, but already before my changes.
- [x] Docstring coverage is 100% via
tox -e docsorinterrogate -c pyproject.toml(I mean, we should set a good example :smile:). - [x] Updates to documentation:
- [x] Document any relevant additions/changes in
README.rst. - [x] Manually update both the
README.rstanddocs/index.rstfor any new/changed CLI flags. - [x] Any changed/added classes/methods/functions have appropriate
versionadded,versionchanged, ordeprecateddirectives. Find the appropriate next version in the project's__init__.pyfile.
- [x] Document any relevant additions/changes in
Release note
Change --omit-covered from absolute coverage of 100% to relative coverage based on --fail-under
Sorry for the silence! I like this idea, but I want to keep the same behavior (not introduce a breaking change like this, even though it is innocuous), while allowing the option to hide files that meet the --fail-under condition.
I think it'd be a better approach to have --omit-covered-files default to 100% coverage (basically behaving like a flag, as it does right now), but add the ability for --omit-covered-files to take in a value, which can match the --fail-under (so it behaves like an option argument, not just a flag). e.g. supporting the following: interrogate --fail-under 85 --omit-covered-files 85.
Feel free to update this PR; otherwise, I can add this at some point for the next release (1.8.0).