I'm trying to set up Pylint to only do certain inspections and no others, e.g. only check for W0601 and W0612. I've tried using an enable=
line the the [MESSAGES CONTROL]
section of my pylint.rc but that doesn't seem to do what I want.
I'm using Pylint 0.25.1.
Looks like a bug with the way rc files are parsed.
Order matters on the command line (undocumented?) so you need to disable first then enable:
pylint xyz.py --disable R,C,W,E --enable W0601,W0612
But this is not reflected correctly with --generate-rcfile
and does not work with --rcfile
...these are probably bugs. Like #36584.
In the rc file with the disable line, all messages get disabled, even with disable before enable like on the command line.
[MESSAGES CONTROL]
disable=R,C,W,E
enable=W0601,W0612
@aneroid: you may be right that there could be order issue in generating/reading the configuration file; and also that the fact that order matters on the command line should be documented. I've planified and commented the ticket you refer to accordingly.
@peter-graham, so your probably have to use the command line to achieve this until the #36584 ticket is fixed. I would recommend :
pylint --disable-all --enable=W0601,W0612
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With