-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 <[email protected]>
- Loading branch information
1 parent
f54dfd1
commit d064010
Showing
3 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!""" |