Skip to content

Commit 85c32d0

Browse files
[doc] Add generated disclaimer in result of generated documentation
1 parent 2f6b017 commit 85c32d0

File tree

8 files changed

+36
-13
lines changed

8 files changed

+36
-13
lines changed

doc/exts/pylint_extensions.py

+7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ def builder_inited(app: Optional[Sphinx]) -> None:
5151
)
5252
with open(extensions_doc, "w", encoding="utf-8") as stream:
5353
stream.write(get_rst_title("Optional checkers", "="))
54+
stream.write(
55+
"""
56+
.. This file is auto-generated. Make any changes to the associated
57+
.. docs extension in 'doc/exts/pylint_extensions.py'.
58+
59+
"""
60+
)
5461
stream.write("Pylint provides the following optional plugins:\n\n")
5562
for module in modules:
5663
stream.write(f"- :ref:`{module}`\n")

doc/exts/pylint_features.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from sphinx.application import Sphinx
1616

1717
from pylint.lint import PyLinter
18-
from pylint.utils import print_full_documentation
18+
from pylint.utils import get_rst_title, print_full_documentation
1919

2020

2121
# pylint: disable-next=unused-argument
@@ -28,9 +28,14 @@ def builder_inited(app: Optional[Sphinx]) -> None:
2828
linter.load_default_plugins()
2929
features = os.path.join(base_path, "doc", "user_guide", "checkers", "features.rst")
3030
with open(features, "w", encoding="utf-8") as stream:
31-
stream.write("Pylint features\n")
32-
stream.write("===============\n\n")
33-
stream.write(".. generated by pylint --full-documentation\n\n")
31+
stream.write(get_rst_title("Pylint features", "="))
32+
stream.write(
33+
"""
34+
.. This file is auto-generated. Make any changes to the associated
35+
.. docs extension in 'doc/exts/pylint_features.py'.
36+
37+
"""
38+
)
3439
print_full_documentation(linter, stream)
3540

3641

doc/exts/pylint_messages.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ def _write_messages_list_page(
254254
255255
{"#" * len(title)}
256256
{get_rst_title(title, "#")}
257-
..
258-
NOTE This file is auto-generated. Make any changes to the associated
259-
docs extension in 'doc/exts/pylint_messages.py'.
257+
258+
.. This file is auto-generated. Make any changes to the associated
259+
.. docs extension in 'doc/exts/pylint_messages.py'.
260260
261261
Pylint can emit the following messages:
262262

doc/exts/pylint_options.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def _create_checker_section(
6767
checker: str, options: list[OptionsData], linter: PyLinter
6868
) -> str:
6969
checker_string = get_rst_title(f"``{checker.capitalize()}`` Checker", "^")
70-
7170
toml_doc = tomlkit.document()
7271
pylint_tool_table = tomlkit.table(is_super_table=True)
7372
toml_doc.add(tomlkit.key(["tool", "pylint"]), pylint_tool_table)
@@ -133,7 +132,11 @@ def _create_checker_section(
133132

134133
def _write_options_page(options: OptionsDataDict, linter: PyLinter) -> None:
135134
"""Create or overwrite the options page."""
136-
sections: list[str] = [get_rst_title("Standard Checkers:", "^")]
135+
sections: list[str] = [
136+
".. This file is auto-generated. Make any changes to the associated\n"
137+
".. docs extension in 'doc/exts/pylint_options.py'.",
138+
get_rst_title("Standard Checkers:", "^"),
139+
]
137140
found_extensions = False
138141

139142
for checker, checker_options in options.items():

doc/user_guide/checkers/extensions.rst

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Optional checkers
22
=================
3+
4+
.. This file is auto-generated. Make any changes to the associated
5+
.. docs extension in 'doc/exts/pylint_extensions.py'.
6+
37
Pylint provides the following optional plugins:
48

59
- :ref:`pylint.extensions.bad_builtin`

doc/user_guide/checkers/features.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Pylint features
22
===============
33

4-
.. generated by pylint --full-documentation
4+
.. This file is auto-generated. Make any changes to the associated
5+
.. docs extension in 'doc/exts/pylint_features.py'.
56
67
Pylint global options and switches
78
----------------------------------

doc/user_guide/configuration/all-options.rst

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

22

3+
.. This file is auto-generated. Make any changes to the associated
4+
.. docs extension in 'doc/exts/pylint_options.py'.
5+
36
Standard Checkers:
47
^^^^^^^^^^^^^^^^^^
58

doc/user_guide/messages/messages_overview.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
Messages overview
66
#################
77

8-
..
9-
NOTE This file is auto-generated. Make any changes to the associated
10-
docs extension in 'doc/exts/pylint_messages.py'.
8+
9+
.. This file is auto-generated. Make any changes to the associated
10+
.. docs extension in 'doc/exts/pylint_messages.py'.
1111
1212
Pylint can emit the following messages:
1313

0 commit comments

Comments
 (0)