diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-02-22 23:31:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-22 22:31:06 +0000 |
commit | d064010c324cb20a83928c5bae02386ea73fe8d7 (patch) | |
tree | d85332d83847df6168f71c3ebf8fc7eb617a055f | |
parent | f54dfd1a09d1dca9730b0a2a18c15a32d52ef9fd (diff) | |
download | pylint-git-d064010c324cb20a83928c5bae02386ea73fe8d7.tar.gz |
[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>
-rw-r--r-- | doc/data/messages/s/suppressed-message/bad.py | 9 | ||||
-rw-r--r-- | doc/data/messages/s/suppressed-message/details.rst | 5 | ||||
-rw-r--r-- | doc/data/messages/s/suppressed-message/good.py | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/doc/data/messages/s/suppressed-message/bad.py b/doc/data/messages/s/suppressed-message/bad.py new file mode 100644 index 000000000..5b4c437ac --- /dev/null +++ b/doc/data/messages/s/suppressed-message/bad.py @@ -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] diff --git a/doc/data/messages/s/suppressed-message/details.rst b/doc/data/messages/s/suppressed-message/details.rst index ab8204529..ceb0ba72c 100644 --- a/doc/data/messages/s/suppressed-message/details.rst +++ b/doc/data/messages/s/suppressed-message/details.rst @@ -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. diff --git a/doc/data/messages/s/suppressed-message/good.py b/doc/data/messages/s/suppressed-message/good.py index c40beb573..39c362480 100644 --- a/doc/data/messages/s/suppressed-message/good.py +++ b/doc/data/messages/s/suppressed-message/good.py @@ -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!""" |