A tool (and pre-commit hook) to automatically remove unnecessary # pylint: disable
comments, for example: a check that's no longer applicable (say you increased your
max line length), a mistake (# pylint: disable
added to a line that wasn't failing),
or other code in the file caused it to no longer need a # pylint: disable
(such as an unused import).
NOTE: this is lifted from yesqa, whose license is included here (as per its terms).
pip install pylint-reenable
$ pylint-reenable my_file.py
See pre-commit for instructions
Sample .pre-commit-config.yaml
:
- repo: https://github.com/MarcoGorelli/pylint-reenable
rev: v0.1.4
hooks:
- id: pylint-reenable
If you need to select a specific version of pylint and/or run with specific
pylint plugins, add them to additional_dependencies
.