Skip to content

Commit 351b6f9

Browse files
Modify message generation
1 parent 4057bbc commit 351b6f9

File tree

6 files changed

+27
-31
lines changed

6 files changed

+27
-31
lines changed

.readthedocs.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ build:
1414
os: ubuntu-20.04
1515
tools:
1616
python: "3.8"
17+
18+
Type: Page Redirect
19+
From URL: example.html
20+
To URL: examples/intro.html

doc/exts/pylint_messages.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,11 @@ def _write_messages_list_page(
248248
with open(messages_file, "w", encoding="utf-8") as stream:
249249
# Write header of file
250250
stream.write(
251-
f""".. _messages-list:
252-
253-
{get_rst_title("Overview of all Pylint messages", "=")}
251+
""".. _messages-list:
254252
..
255253
NOTE This file is auto-generated. Make any changes to the associated
256254
docs extension in 'pylint_messages.py'.
257255
258-
Pylint can emit the following messages:
259-
260256
"""
261257
)
262258

@@ -280,7 +276,7 @@ def _write_messages_list_page(
280276

281277
# Write list per category
282278
stream.write(
283-
f"""{get_rst_title(category.capitalize(), "-")}
279+
f"""{get_rst_title(category.capitalize(), "=")}
284280
All messages in the {category} category:
285281
286282
.. toctree::

doc/user_guide/index.rst

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ User Guide
1515
features
1616
additional_commands/index.rst
1717
messages/index.rst
18-
messages/message_control.rst
19-
messages/messages_list.rst
2018
output
2119
options
2220
c_extensions

doc/user_guide/messages/index.rst

+10-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
Messages
44
========
55

6-
Pylint can emit various messages. These are categorized according
7-
to categories corresponding to bit-encoded exit codes:
6+
Pylint messages are categorized and each category correspond to a bit-encoded exit codes:
87

98
* :ref:`Fatal <user_guide/messages/messages_list:Fatal>` (1)
109
* :ref:`Error <user_guide/messages/messages_list:Error>` (2)
@@ -13,10 +12,15 @@ to categories corresponding to bit-encoded exit codes:
1312
* :ref:`Refactor <user_guide/messages/messages_list:Refactor>` (16)
1413
* :ref:`Information <user_guide/messages/messages_list:Information>` (NA)
1514

16-
A list of these messages can be found in :ref:`messages-list`
17-
18-
``pylint`` has an advanced message control for its checks, offering the ability
19-
to enable / disable a message either from the command line or from the configuration
15+
Each message can be enabled / disabled from the command line or from the configuration
2016
file, as well as from the code itself.
2117

2218
For more detail see :ref:`message_control`
19+
20+
21+
.. toctree::
22+
:titlesonly:
23+
:hidden:
24+
25+
message_control
26+
messages_list

doc/user_guide/messages/message_control.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _message_control:
22

33
Messages control
4-
================
4+
----------------
55

66
In order to control messages, ``pylint`` accepts the following values:
77

@@ -25,7 +25,7 @@ In order to control messages, ``pylint`` accepts the following values:
2525

2626

2727
Module disable
28-
--------------
28+
^^^^^^^^^^^^^^
2929

3030
Add ``#pylint: skip-file`` at the beginning of the module.
3131

@@ -41,7 +41,7 @@ top of the file: ::
4141

4242

4343
Inline disable
44-
--------------
44+
^^^^^^^^^^^^^^
4545

4646
For just a single line, add ``#pylint: disable=some-message,another-one`` at the end of
4747
the desired line of code. Since Pylint 2.10 you can also use ``#pylint: disable-next=...``
@@ -50,7 +50,7 @@ list of messages you want to disable.
5050

5151

5252
Block disables
53-
--------------
53+
^^^^^^^^^^^^^^
5454

5555
For larger amounts of code, you can add ``#pylint: disable=...`` at the block level
5656
to disable messages for the entire block. It's possible to re-enable a message for the
@@ -225,7 +225,7 @@ Here's an example with all these rules in a single place:
225225

226226

227227
Detecting useless disables
228-
--------------------------
228+
^^^^^^^^^^^^^^^^^^^^^^^^^^
229229

230230
As pylint gets better and false positives are removed,
231231
disables that became useless can accumulate and clutter the code.

doc/user_guide/messages/messages_list.rst

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
.. _messages-list:
2-
3-
Overview of all Pylint messages
4-
===============================
5-
62
..
73
NOTE This file is auto-generated. Make any changes to the associated
84
docs extension in 'pylint_messages.py'.
95
10-
Pylint can emit the following messages:
11-
126
Fatal
13-
-----
7+
=====
148

159
All messages in the fatal category:
1610

@@ -34,7 +28,7 @@ All renamed messages in the fatal category:
3428

3529

3630
Error
37-
-----
31+
=====
3832

3933
All messages in the error category:
4034

@@ -178,7 +172,7 @@ All renamed messages in the error category:
178172

179173

180174
Warning
181-
-------
175+
=======
182176

183177
All messages in the warning category:
184178

@@ -345,7 +339,7 @@ All renamed messages in the warning category:
345339

346340

347341
Convention
348-
----------
342+
==========
349343

350344
All messages in the convention category:
351345

@@ -423,7 +417,7 @@ All renamed messages in the convention category:
423417

424418

425419
Refactor
426-
--------
420+
========
427421

428422
All messages in the refactor category:
429423

@@ -512,7 +506,7 @@ All renamed messages in the refactor category:
512506

513507

514508
Information
515-
-----------
509+
===========
516510

517511
All messages in the information category:
518512

0 commit comments

Comments
 (0)