Is it possible to ignore one single specific line with pylint?
I have the following line in my header:
This actually changes my python logging settings, but pylint thinks it is an unused import. I do not want to remove
unused-import warnings in general so is it possible to just ignore this one specific line?
I wouldn't mind having a
.pylintrc for this project so answers changing a config file will be accepted.
Otherwise, something like this will also be appreciated:
import config.logging_settings # pylint: disable-this-line-in-some-way
Pylint message control is documented in the Pylint manual:
Is it possible to locally disable a particular message?
Yes, this feature has been added in Pylint 0.11. This may be done by adding
at the desired block level or at the end of the desired line of code
You can use the message code or the symbolic names.
The manual also has an example.
There is a wiki that documents all pylint messages and their codes.
★ Back to homepage or read more recommendations: