-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[doc] Add an example for suppressed-message #8328
Conversation
The message would not be triggered if implicit-str-concat is not activated too. I initially wanted to activate invalid-name so we follow pep8 in our examples but there's more than 50 violations right now. So 'implicit-str-concat' it is.
@@ -0,0 +1 @@ | |||
test = ["a" "b"] # pylint: disable=implicit-str-concat # [suppressed-message] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to do this with a pylintrc
that enables the message and then disable it here.
The enable in the running of the tests is just additional "headspace" that gets occupied when dealing with these tests.
The fact that we had so many issues with just disabling the cleaning of messages after each file shows that neither of us (or other maintainers) fully understand all the implications of the functional test runners.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that too (and also enable in file) but I think pylintrc is the baseline that is modified by the command line argument. Not sure if it's possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, of course..
Or... A specific enable
in the bad.py
file? And then a disable a line later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, that's what you just said. That doesn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I tried to use disable-next to enable the suppressed message and that did not work for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, not sure why, I think the right order for message control should be "configuration < commande line < file directive according to scope":
$ cat a.py
# pylint: enable=invalid-name
tEsT = "apple" # pylint: disable=invalid-name
$ pylint a.py --disable=all --enable=invalid-name,suppressed-message,astroid-error,syntax-error
************* Module a
a.py:2:0: I0020: Suppressed 'invalid-name' (from line 2) (suppressed-message)
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
$ pylint a.py --disable=all --enable=suppressed-message,astroid-error,syntax-error
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
Clearly fixing the message control is a task that is not going to be tackled like a young ballerina by SΓ©bastien Chabal.
@Pierre-Sassoulas I know this is awful, but at least it shows what the behaviour is.. |
Hmm maybe it's due to the way "all" behave and take precedence. Definitely something to consider in #3696 |
Let's merge this ! You'll have to approve your own change @DanielNoord π |
Something fishy is going on for sure as the second Anyway, I much prefer to keep all of these weird issues contained to one documentation example rather than affecting all other tests for it. |
Removing errors and pep8 smells from documentation examples is valuable in itself but this is something from another time. There's 50+ invalid-name violations currently. But we clearly have better things to do. |
Type of Changes
Description
The message would not be triggered if implicit-str-concat is not activated too. I initially wanted to activate invalid-name so we follow pep8 in our examples but there's more than 50 violations right now. So 'implicit-str-concat' it is.
Refs #7897 #5953