Skip to content

Commit

Permalink
[doc] Add an example for suppressed-message (#8328)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Pierre-Sassoulas and DanielNoord authored Feb 22, 2023
1 parent f54dfd1 commit d064010
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions doc/data/messages/s/suppressed-message/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### This is a contrived example, to show how suppressed-message works.
### First we enable all messages
# pylint: enable=all

### Here we disable two messages so we get two warnings
# pylint: disable=locally-disabled, useless-suppression # [suppressed-message, suppressed-message]

### Here we disable a message, so we get a warning for suppressed-message again.
"A" # pylint: disable=pointless-statement # [suppressed-message, suppressed-message]
5 changes: 4 additions & 1 deletion doc/data/messages/s/suppressed-message/details.rst
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !
``suppressed-message`` is simply a way to see messages that would be raised
without the disable in your codebase. It should not be activated most
of the time. See also ``useless-suppression`` if you want to see the message
that are disabled for no reasons.
2 changes: 1 addition & 1 deletion doc/data/messages/s/suppressed-message/good.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# This is a placeholder for correct code for this message.
"""Instead of a single string somewhere in the file, write a module docstring!"""

0 comments on commit d064010

Please sign in to comment.