A pylint plugin to ignore error codes per file.
Actively maintained. Last release 2 months ago, commits in 26 of the last 26 weeks. A safe choice.
pip install pylint-per-file-ignoresREADME as published on PyPI with version 4.0.0.
Pylint Per File Ignores
This pylint plugin will enable per-file-ignores in your project!
The project was initially created by christopherpickering.
Install
pip install pylint-per-file-ignores
Add to Pylint Settings
.pylintrc
[MAIN]
load-plugins =
pylint_per_file_ignores
setup.cfg
[pylint.MASTER]
load-plugins =
pylint_per_file_ignores
pyproject.toml
[tool.pylint.main]
load-plugins = [
"pylint_per_file_ignores",
]
Usage
Add a list of patterns and codes you would like to ignore following <file-pattern>:<code1>,<code2>.
The patterns are matched using globs.
Newlines between codes are supported.
Prior to v2.0.0,
pylint-per-file-ignoresdid not use globs but regex. When migrating, please check your configuration carefully.
Please note, that if two patterns applies the same files, the last configuration will be used.
.pylintrc
[MESSAGES CONTROL]
per-file-ignores =
/folder_1/*:missing-function-docstring,W0621,W0240,C0115
file.py:C0116,E0001
setup.cfg
[pylint.MESSAGES CONTROL]
per-file-ignores =
/folder_1/*:missing-function-docstring,W0621,W0240,C0115
file.py:C0116,E0001
pyproject.toml
[tool.pylint.'messages control']
per-file-ignores = [
"/folder_1/*:missing-function-docstring,W0621,W0240,C0115",
"file.py:C0116,E0001"
]