diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-06-06 10:42:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-06 10:42:17 +0200 |
commit | 0da426fd3750de02a1cf358c034e3f888c8e6bee (patch) | |
tree | 8dcf450d717c967b3e187e7f63888e360151a0aa /pylint/utils | |
parent | a5ca674cf12f3bffbd90370c7595ec2f20abe953 (diff) | |
download | pylint-git-0da426fd3750de02a1cf358c034e3f888c8e6bee.tar.gz |
Remove redundant options documentation and improve formatting (#6665)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'pylint/utils')
-rw-r--r-- | pylint/utils/docs.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/pylint/utils/docs.py b/pylint/utils/docs.py index 0995d5a68..ebd7cc8c3 100644 --- a/pylint/utils/docs.py +++ b/pylint/utils/docs.py @@ -64,9 +64,13 @@ Pylint provides global options and switches. return result -def _get_checkers_documentation(linter: PyLinter) -> str: +def _get_checkers_documentation(linter: PyLinter, show_options: bool = True) -> str: """Get documentation for individual checkers.""" - result = _get_global_options_documentation(linter) + if show_options: + result = _get_global_options_documentation(linter) + else: + result = "" + result += get_rst_title("Pylint checkers' options and switches", "-") result += """\ @@ -84,10 +88,16 @@ Below is a list of all checkers and their features. information = by_checker[checker_name] checker = information["checker"] del information["checker"] - result += checker.get_full_documentation(**information) + result += checker.get_full_documentation( + **information, show_options=show_options + ) return result -def print_full_documentation(linter: PyLinter, stream: TextIO = sys.stdout) -> None: +def print_full_documentation( + linter: PyLinter, stream: TextIO = sys.stdout, show_options: bool = True +) -> None: """Output a full documentation in ReST format.""" - print(_get_checkers_documentation(linter)[:-3], file=stream) + print( + _get_checkers_documentation(linter, show_options=show_options)[:-3], file=stream + ) |