Open RuRo opened 1 year ago
This seems like expected behaviour.
# pylint: disable=all
is deprecated and the new way is to use # pylint: skip-file
(the wording of the latter way makes it clear why the checks are disabled for the entire file).
The deprecated-pragma warning is disabled by default:
pylint --enable=deprecated-pragma example.py
example.py:11:0: I0022: Pragma "disable=all" is deprecated, use "skip-file" instead (deprecated-pragma)
deprecated-pragma previously was known as deprecated-disable-all.
@mbyrnepr2 I think, that the current behaviour is still broken. Either disable=all
should work as expected, or it should warn about it being deprecated (by default).
The fact that it's a synonym (?) for skip-file
is not obvious to the user. For example, if I see such a disable=all
marker during core review, I would naturally assume that it only silences the warnings current line/block.
Yeah I don't know why deprecated-pragma
would be disabled by default :)
Let's open a merge-request and see if anyone has an opinion on changing this or leaving it alone.
Ok we have a reason not to do this. Please see this comment regarding a wider design-change around these pragmas.
Hi Mark. Thanks for digging into the relevant context here. I didn't know about any of this.
Please see https://github.com/pylint-dev/pylint/pull/8731#issuecomment-1572582489 regarding a wider design-change around these pragmas.
I wonder if that's an orthogonal issue. Pierre wants to wait if our idea is to make the deprecation more visible, but that's a big if. What if we just fix the behavior to not be surprising and forget about a deprecation that no one has ever seen?
The fact that it's a synonym (?) for skip-file is not obvious to the user. For example, if I see such a disable=all marker during core review, I would naturally assume that it only silences the warnings current line/block.
👍
Reopening to continue the discussion about whether to "undo" the deprecation and fix it.
Bug description
Consider the following example:
For some reason, the
disable=all
comment disables the warnings for the whole file, instead of only for the current block/current line/next line/etc. Compare this with the exact same file, but withdisable=invalid-name
instead ofdisable=all
.Configuration
None
Command used
Pylint output
Expected output
Pylint version
OS / Environment
Manjaro (Arch Linux)
Additional dependencies