Skip to content

Commit d064010

Browse files
[doc] Add an example for suppressed-message (#8328)
I initially wanted to activate invalid-name so we follow pep8 in our examples but there's more than 50 violations right now. I much prefer to keep all of these weird issues contained to one documentation example rather than affecting all other tests for it. Co-authored-by: Daniel van Noord <13665637+DanielNoord@users.noreply.github.com>
1 parent f54dfd1 commit d064010

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### This is a contrived example, to show how suppressed-message works.
2+
### First we enable all messages
3+
# pylint: enable=all
4+
5+
### Here we disable two messages so we get two warnings
6+
# pylint: disable=locally-disabled, useless-suppression # [suppressed-message, suppressed-message]
7+
8+
### Here we disable a message, so we get a warning for suppressed-message again.
9+
"A" # pylint: disable=pointless-statement # [suppressed-message, suppressed-message]
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !
1+
``suppressed-message`` is simply a way to see messages that would be raised
2+
without the disable in your codebase. It should not be activated most
3+
of the time. See also ``useless-suppression`` if you want to see the message
4+
that are disabled for no reasons.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# This is a placeholder for correct code for this message.
1+
"""Instead of a single string somewhere in the file, write a module docstring!"""

0 commit comments

Comments
 (0)