interrogate icon indicating copy to clipboard operation
interrogate copied to clipboard

Change --omit-covered from 100% coverage to --fail-under value

Open strobeflash opened this issue 3 years ago • 1 comments

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 docs or interrogate -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.rst and docs/index.rst for any new/changed CLI flags.
    • [x] Any changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives. Find the appropriate next version in the project's __init__.py file.

Release note

Change --omit-covered from absolute coverage of 100% to relative coverage based on --fail-under

strobeflash avatar Jun 18 '22 05:06 strobeflash

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).

econchick avatar Apr 08 '24 18:04 econchick