diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2022-05-23 15:06:49 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2022-05-24 08:52:32 +0200 |
commit | 23665988d7862577fb3390535c84a7c8aa1c29a9 (patch) | |
tree | 7c2d81bd5df182f63eaaec60a7f2739fe603516a /doc/exts | |
parent | c04ba16727f171742ef7fa1e8c70b09fbfef5eb5 (diff) | |
download | pylint-git-23665988d7862577fb3390535c84a7c8aa1c29a9.tar.gz |
[doc] Add generated disclaimer in result of generated documentation
Diffstat (limited to 'doc/exts')
-rwxr-xr-x | doc/exts/pylint_extensions.py | 7 | ||||
-rwxr-xr-x | doc/exts/pylint_features.py | 13 | ||||
-rw-r--r-- | doc/exts/pylint_messages.py | 6 | ||||
-rw-r--r-- | doc/exts/pylint_options.py | 7 |
4 files changed, 24 insertions, 9 deletions
diff --git a/doc/exts/pylint_extensions.py b/doc/exts/pylint_extensions.py index ce10fa637..fe80f7a51 100755 --- a/doc/exts/pylint_extensions.py +++ b/doc/exts/pylint_extensions.py @@ -51,6 +51,13 @@ def builder_inited(app: Optional[Sphinx]) -> None: ) with open(extensions_doc, "w", encoding="utf-8") as stream: stream.write(get_rst_title("Optional checkers", "=")) + stream.write( + """ +.. This file is auto-generated. Make any changes to the associated +.. docs extension in 'doc/exts/pylint_extensions.py'. + +""" + ) stream.write("Pylint provides the following optional plugins:\n\n") for module in modules: stream.write(f"- :ref:`{module}`\n") diff --git a/doc/exts/pylint_features.py b/doc/exts/pylint_features.py index 9faac95bd..e2eb57d74 100755 --- a/doc/exts/pylint_features.py +++ b/doc/exts/pylint_features.py @@ -15,7 +15,7 @@ import sphinx from sphinx.application import Sphinx from pylint.lint import PyLinter -from pylint.utils import print_full_documentation +from pylint.utils import get_rst_title, print_full_documentation # pylint: disable-next=unused-argument @@ -28,9 +28,14 @@ def builder_inited(app: Optional[Sphinx]) -> None: linter.load_default_plugins() features = os.path.join(base_path, "doc", "user_guide", "checkers", "features.rst") with open(features, "w", encoding="utf-8") as stream: - stream.write("Pylint features\n") - stream.write("===============\n\n") - stream.write(".. generated by pylint --full-documentation\n\n") + stream.write(get_rst_title("Pylint features", "=")) + stream.write( + """ +.. This file is auto-generated. Make any changes to the associated +.. docs extension in 'doc/exts/pylint_features.py'. + +""" + ) print_full_documentation(linter, stream) diff --git a/doc/exts/pylint_messages.py b/doc/exts/pylint_messages.py index e04c60ded..460f4c018 100644 --- a/doc/exts/pylint_messages.py +++ b/doc/exts/pylint_messages.py @@ -254,9 +254,9 @@ def _write_messages_list_page( {"#" * len(title)} {get_rst_title(title, "#")} -.. - NOTE This file is auto-generated. Make any changes to the associated - docs extension in 'doc/exts/pylint_messages.py'. + +.. This file is auto-generated. Make any changes to the associated +.. docs extension in 'doc/exts/pylint_messages.py'. Pylint can emit the following messages: diff --git a/doc/exts/pylint_options.py b/doc/exts/pylint_options.py index e6bd60b43..0451f7989 100644 --- a/doc/exts/pylint_options.py +++ b/doc/exts/pylint_options.py @@ -67,7 +67,6 @@ def _create_checker_section( checker: str, options: list[OptionsData], linter: PyLinter ) -> str: checker_string = get_rst_title(f"``{checker.capitalize()}`` Checker", "^") - toml_doc = tomlkit.document() pylint_tool_table = tomlkit.table(is_super_table=True) toml_doc.add(tomlkit.key(["tool", "pylint"]), pylint_tool_table) @@ -133,7 +132,11 @@ def _create_checker_section( def _write_options_page(options: OptionsDataDict, linter: PyLinter) -> None: """Create or overwrite the options page.""" - sections: list[str] = [get_rst_title("Standard Checkers:", "^")] + sections: list[str] = [ + ".. This file is auto-generated. Make any changes to the associated\n" + ".. docs extension in 'doc/exts/pylint_options.py'.", + get_rst_title("Standard Checkers:", "^"), + ] found_extensions = False for checker, checker_options in options.items(): |