Skip to content

Commit e2dbc93

Browse files
[doc] Reorganize the doc table of content with four levels
User, developper, contributor, maintainer.
1 parent ef40b99 commit e2dbc93

38 files changed

+197
-113
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ doc/user_guide/messages/fatal/
1717
doc/user_guide/messages/information/
1818
doc/user_guide/messages/refactor/
1919
doc/user_guide/messages/warning/
20-
doc/technical_reference/extensions.rst
21-
doc/technical_reference/features.rst
20+
doc/user_guide/checkers/extensions.rst
21+
doc/user_guide/checkers/features.rst
2222
doc/user_guide/configuration/all-options.rst
2323
pyve
2424
build-stamp

doc/conf.py

+31-5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"sphinx.ext.autosectionlabel",
4444
"sphinx.ext.intersphinx",
4545
"sphinx_reredirects",
46+
"myst_parser",
4647
]
4748

4849

@@ -54,18 +55,43 @@
5455
# https://readthedocs.org/dashboard/pylint/redirects/
5556
redirects: dict[str, str] = {
5657
# "<source>": "<target>"
57-
"intro": "index.html",
58-
"support": "contact.html",
59-
"user_guide/ide-integration": "installation.html",
6058
"additional_commands/index": "../index.html",
59+
"development_guide/index": "api/index.html",
60+
"development_guide/contribute": "../development_guide/contributor_guide/index.html",
61+
"development_guide/contributor_guide": "contributor_guide/index.html",
62+
"development_guide/tests/index": "../contributor_guide/tests/index.html",
63+
"development_guide/tests/install": "../contributor_guide/tests/install.html",
64+
"development_guide/tests/launching_test": "../contributor_guide/tests/launching_test.html",
65+
# There was a typo in the original file, don't fix.
66+
"development_guide/tests/writting_test": "../contributor_guide/tests/writing_test.html",
67+
"development/testing": "tests/index.html",
68+
"how_tos/custom_checkers": "../development_guide/how_tos/custom_checkers.html",
69+
"how_tos/index": "../development_guide/how_tos/index.html",
70+
"how_tos/plugins": "../development_guide/how_tos/plugins.html",
71+
"how_tos/transform_plugins": "../development_guide/how_tos/transform_plugins.html",
72+
"intro": "index.html",
6173
"messages/messages_introduction": "../user_guide/messages/index.html",
6274
"messages/messages_list": "../user_guide/messages/messages_overview.html",
63-
"user_guide/message-control": "messages/message_control.html",
75+
"support": "contact.html",
6476
"technical_reference/c_extensions": "../user_guide/messages/error/no-member.html",
77+
"technical_reference/checkers": "../development_guide/technical_reference/checkers.html",
78+
"technical_reference/features": "../user_guide/checkers/features.html",
79+
"technical_reference/index": "../development_guide/technical_reference/index.html",
80+
"technical_reference/startup": "../development_guide/technical_reference/startup.html",
6581
"user_guide/configuration/naming-styles": "../user_guide/messages/convention/invalid-name.html",
66-
"development/testing": "tests/index.html",
82+
"user_guide/ide_integration/flymake-emacs": "../installation/ide_integration/flymake-emacs.html",
83+
"user_guide/ide_integration/ide-integration": "../installation/ide_integration/index.html",
84+
"user_guide/ide-integration": "installation.html",
85+
"user_guide/ide_integration/textmate": "../installation/ide_integration/textmate.html",
86+
"user_guide/index": "installation/index.html",
87+
"user_guide/message-control": "messages/message_control.html",
88+
"user_guide/options": "configuration/all-options.html",
89+
"user_guide/output": "usage/output.html",
90+
"user_guide/pre-commit-integration": "installation/pre-commit-integration.html",
91+
"user_guide/run": "usage/run.html",
6792
}
6893

94+
6995
# Add any paths that contain templates here, relative to this directory.
7096
templates_path = ["_templates"]
7197

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Contributing to pylint
2+
======================
3+
4+
The contributor guide will help you if you want to contribute to pylint itself.
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
:titlesonly:
9+
10+
contribute
11+
tests/index
12+
release
File renamed without changes.

doc/development_guide/tests/index.rst renamed to doc/development_guide/contributor_guide/tests/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ unless they include tests.
1515

1616
install
1717
launching_test
18-
writting_test
18+
writing_test
File renamed without changes.
File renamed without changes.

doc/development_guide/index.rst

-11
This file was deleted.

doc/technical_reference/index.rst renamed to doc/development_guide/technical_reference/index.rst

-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@ Technical Reference
1414

1515
startup
1616
checkers
17-
extensions
18-
features

doc/exts/pylint_extensions.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ def builder_inited(app: Optional[Sphinx]) -> None:
4747
linter.load_plugin_modules(modules)
4848

4949
extensions_doc = os.path.join(
50-
base_path, "doc", "technical_reference", "extensions.rst"
50+
base_path, "doc", "user_guide", "checkers", "extensions.rst"
5151
)
5252
with open(extensions_doc, "w", encoding="utf-8") as stream:
53-
stream.write(
54-
get_rst_title("Optional Pylint checkers in the extensions module", "=")
55-
)
53+
stream.write(get_rst_title("Optional checkers", "="))
5654
stream.write("Pylint provides the following optional plugins:\n\n")
5755
for module in modules:
5856
stream.write(f"- :ref:`{module}`\n")

doc/exts/pylint_features.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def builder_inited(app: Optional[Sphinx]) -> None:
2424
)
2525
linter = PyLinter()
2626
linter.load_default_plugins()
27-
features = os.path.join(base_path, "doc", "technical_reference", "features.rst")
27+
features = os.path.join(base_path, "doc", "user_guide", "checkers", "features.rst")
2828
with open(features, "w", encoding="utf-8") as stream:
2929
stream.write("Pylint features\n")
3030
stream.write("===============\n\n")

doc/exts/pylint_options.py

-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ def _write_options_page(options: OptionsDataDict, linter: PyLinter) -> None:
150150
) as stream:
151151
stream.write(
152152
f"""
153-
{get_rst_title("All pylint options", "=")}
154153
155154
{sections_string}
156155
"""

doc/faq.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Alternatively, if you use ``pyproject.toml``, e.g.
147147
]
148148
149149
See also the :ref:`exhaustive list of possible options
150-
<user_guide/configuration/all-options:all pylint options>`.
150+
<all-configurations-options>`.
151151

152152
4.7 Why are there a bunch of messages disabled by default?
153153
----------------------------------------------------------
@@ -157,7 +157,7 @@ they are prone to false positives or that they are opinionated enough
157157
for not being included as default messages.
158158

159159
You can see the plugin you need to explicitly :ref:`load in the technical reference
160-
<technical_reference/extensions:optional pylint checkers in the extensions module>`.
160+
<user_guide/checkers/extensions:optional checkers>`.
161161

162162
4.8 I am using another popular linter alongside pylint. Which messages should I disable to avoid duplicates?
163163
------------------------------------------------------------------------------------------------------------

doc/index.rst

+42-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,49 @@
66
:hidden:
77

88
tutorial
9-
user_guide/index.rst
10-
how_tos/index.rst
11-
technical_reference/index.rst
12-
development_guide/index.rst
9+
10+
.. toctree::
11+
:caption: User Guide
12+
:titlesonly:
13+
:hidden:
14+
15+
user_guide/installation/index
16+
user_guide/usage/index
17+
user_guide/messages/index
18+
user_guide/configuration/index
19+
user_guide/checkers/index
20+
21+
.. toctree::
22+
:caption: Developer Guide
23+
:maxdepth: 2
24+
:titlesonly:
25+
:hidden:
26+
27+
development_guide/api/index
28+
development_guide/how_tos/index.rst
29+
development_guide/technical_reference/index.rst
30+
development_guide/profiling
31+
development_guide/contributor_guide/index
32+
33+
.. toctree::
34+
:caption: Additional tools
35+
:titlesonly:
36+
:hidden:
37+
1338
pyreverse
1439
symilar
40+
41+
.. toctree::
42+
:caption: Changelog
43+
:titlesonly:
44+
:hidden:
45+
46+
whatsnew/index.rst
47+
48+
.. toctree::
49+
:caption: Support
50+
:titlesonly:
51+
:hidden:
52+
1553
faq
1654
contact
17-
whatsnew/index.rst

doc/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Sphinx==4.5.0
22
sphinx-reredirects<1
3+
myst-parser~=0.16
34
furo==2022.4.7
45
-e .

doc/user_guide/checkers/index.rst

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Checkers
2+
========
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
:titlesonly:
7+
:hidden:
8+
9+
features
10+
extensions
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. _all-configurations-options:
2+
3+
=============
4+
Configuration
5+
=============
6+
7+
Pylint is highly configurable. There's a lot of options to follow the need of
8+
every projects and a lot of checks to activate if they suit your style.
9+
10+
.. toctree::
11+
:maxdepth: 2
12+
:titlesonly:
13+
14+
all-options

doc/user_guide/ide_integration/ide-integration.rst

-11
This file was deleted.

doc/user_guide/index.rst

-16
This file was deleted.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.. _installation:
2+
3+
Command line installation
4+
-------------------------
5+
6+
Pylint is installable using a package manager. Your package manager will find a version that
7+
works with your interpreter. We recommend ``pip``:
8+
9+
.. code-block:: sh
10+
11+
pip install pylint
12+
13+
Use the newest Python interpreter if you can.
14+
15+
It's possible to analyse code written for older interpreters by using the ``py-version``
16+
option and setting it to the old interpreter. For example you can check that there are
17+
no ``f-strings`` in Python 3.5 code using Python 3.8 with an up-to-date pylint even if
18+
Python 3.5 is past end of life (EOL).
19+
20+
We do not guarantee that ``py-version`` will work for all EOL python interpreters indefinitely,
21+
(for anything before python 3.5, it's probably not). If a newer version does not work for you,
22+
the best available pylint might be an old version that works with your old interpreter but
23+
without the bug fixes and feature of later versions.
24+
25+
.. note::
26+
You can also use ``conda`` or your system package manager on debian based OS.
27+
These package managers lag a little behind as they are maintained by a separate
28+
entity on a slower release cycle.
29+
30+
.. code-block:: sh
31+
32+
conda install pylint
33+
34+
.. code-block:: sh
35+
36+
sudo apt-get install pylint
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,11 @@
1-
.. _installation:
2-
3-
Installation
4-
============
5-
6-
Command line
7-
------------
8-
9-
Pylint is installable using a package manager. Your package manager will find a version that
10-
works with your interpreter. We recommend ``pip``:
11-
12-
.. code-block:: sh
13-
14-
pip install pylint
15-
16-
Use the newest Python interpreter if you can.
17-
18-
It's possible to analyse code written for older interpreters by using the ``py-version``
19-
option and setting it to the old interpreter. For example you can check that there are
20-
no ``f-strings`` in Python 3.5 code using Python 3.8 with an up-to-date pylint even if
21-
Python 3.5 is past end of life (EOL).
22-
23-
We do not guarantee that ``py-version`` will work for all EOL python interpreters indefinitely,
24-
(for anything before python 3.5, it's probably not). If a newer version does not work for you,
25-
the best available pylint might be an old version that works with your old interpreter but
26-
without the bug fixes and feature of later versions.
27-
28-
NB: You can also use ``conda`` or your system package manager on debian based OS.
29-
These package managers lag a little behind as they are maintained by a separate
30-
entity on a slower release cycle.
31-
32-
.. code-block:: sh
33-
34-
conda install pylint
35-
36-
.. code-block:: sh
37-
38-
sudo apt-get install pylint
39-
1+
.. _ide-integration:
402

41-
Editor integration
42-
------------------
3+
###########################
4+
Editor and IDE integration
5+
###########################
436

44-
.. _ide-integration:
7+
Pylint can be integrated in various editors and IDE's.
8+
Below you can find tutorials for some of the most common ones.
459

4610
- Eclipse_
4711
- Emacs_
@@ -77,3 +41,11 @@ Editor integration
7741
.. _Visual Studio Code: https://code.visualstudio.com/docs/python/linting#_pylint
7842
.. _Visual Studio Code Pylint Extension: https://marketplace.visualstudio.com/items?itemName=ms-python.pylint
7943
.. _WingIDE: https://wingware.com/doc/warnings/external-checkers
44+
45+
.. toctree::
46+
:maxdepth: 2
47+
:titlesonly:
48+
:hidden:
49+
50+
flymake-emacs.rst
51+
textmate.rst

doc/user_guide/installation/index.rst

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Installation
2+
============
3+
4+
Pylint can be installed:
5+
6+
- As a command line tool
7+
- Integrated in your editor/ide
8+
- As a pre-commit hook
9+
10+
.. toctree::
11+
:maxdepth: 2
12+
:titlesonly:
13+
:hidden:
14+
15+
command_line_installation.rst
16+
ide_integration/index
17+
pre-commit-integration.rst
18+
badge

0 commit comments

Comments
 (0)