Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] Add an example for suppressed-message #8328

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!"""