diff --git a/README.rst b/README.rst index ff269a4..a15c5e8 100644 --- a/README.rst +++ b/README.rst @@ -532,7 +532,7 @@ To view all options available, run ``interrogate --help``: --color / --no-color Toggle color output on/off when printing to stdout. [default: True] - --omit-covered-files Omit reporting files that have 100% + --omit-covered-files Omit reporting files that meet --fail-under documentation coverage. This option is ignored if verbosity is not set. [default: False] diff --git a/docs/index.rst b/docs/index.rst index 3cc8dfc..2a7629c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -108,7 +108,7 @@ Command Line Options .. option:: --omit-covered-files - Omit reporting files that have 100% documentation coverage. + Omit reporting files that meet --fail-under documentation coverage. This option is ignored if verbosity is not set. [default: ``False``] .. option:: -g, --generate-badge PATH diff --git a/src/interrogate/cli.py b/src/interrogate/cli.py index 1676fba..cb50e6c 100644 --- a/src/interrogate/cli.py +++ b/src/interrogate/cli.py @@ -203,8 +203,8 @@ default=False, show_default=True, help=( - "Omit reporting files that have 100% documentation coverage. This " - "option is ignored if verbosity is not set." + "Omit reporting files that meet --fail-under documentation coverage. " + "This option is ignored if verbosity is not set." ), ) @click.option( diff --git a/src/interrogate/config.py b/src/interrogate/config.py index 250f8d2..faa16a1 100644 --- a/src/interrogate/config.py +++ b/src/interrogate/config.py @@ -37,7 +37,7 @@ class InterrogateConfig: :param bool ignore_init_module: Ignore ``__init__.py`` modules. :param str include_regex: Regex identifying class, method, and function names to include. - :param bool omit_covered_files: Omit reporting files that have 100% + :param bool omit_covered_files: Omit reporting files that meet --fail-under documentation coverage. """ diff --git a/src/interrogate/coverage.py b/src/interrogate/coverage.py index cf1fc54..f169be6 100644 --- a/src/interrogate/coverage.py +++ b/src/interrogate/coverage.py @@ -300,7 +300,7 @@ def _sort_nodes(x): for file_result in combined_results.file_results: if ( self.config.omit_covered_files - and file_result.perc_covered == 100 + and file_result.perc_covered >= self.config.fail_under ): continue nodes = file_result.nodes @@ -316,7 +316,8 @@ def _print_detailed_table(self, results): """Print detailed table to the given output stream.""" detailed_table = self._create_detailed_table(results) - # don't print an empty table if --omit-covered & all files have 100% + # don't print an empty table if --omit-covered & all files meet + # --fail-under if len(detailed_table) < 3: return @@ -349,7 +350,7 @@ def _create_summary_table(self, combined_results): filename = self._get_filename(file_result.filename) if ( self.config.omit_covered_files - and file_result.perc_covered == 100 + and file_result.perc_covered >= self.config.fail_under ): continue perc_covered = "{:.0f}%".format(file_result.perc_covered) @@ -436,7 +437,7 @@ def _get_header_base(self): return base + "/" def _print_omitted_file_count(self, results): - """Print # of files omitted due to 100% coverage and --omit-covered. + """Print # of files omitted due to --fail-under and --omit-covered. :param InterrogateResults results: results of docstring coverage interrogation. @@ -445,7 +446,7 @@ def _print_omitted_file_count(self, results): return omitted_files = [ - r for r in results.file_results if r.perc_covered == 100 + r for r in results.file_results if r.perc_covered >= self.config.fail_under ] omitted_file_count = len(omitted_files) if omitted_file_count == 0: @@ -455,7 +456,7 @@ def _print_omitted_file_count(self, results): files_humanized = "files" if total_files_scanned > 1 else "file" files_skipped = ( f"({omitted_file_count} of {total_files_scanned} {files_humanized} " - "omitted due to complete coverage)" + "omitted due to met coverage)" ) to_print = tabulate.tabulate( [self.output_formatter.TABLE_SEPARATOR, [files_skipped]],