Registry / testing / pylint-per-file-ignores

pylint-per-file-ignores

JSON →
library3.2.1pypypiunverified

A Pylint plugin designed to enable granular control over Pylint error codes, allowing specific messages to be ignored per file or directory pattern. It provides a flexible alternative to littering code with `# pylint: disable` comments. This library is actively maintained, with its current version being 3.2.1.

pip install pylint-per-file-ignores
INSTALL
IMPORT
SIG · PYLINT-PER-FILE-IG
P
pylint-per-file-ignores
testingpythonv3.2.1
Install
2.6s avg
Import
Disk
26MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 26.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.6s · import 0.000s · 27MB
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pylint_per_file_ignores
This plugin is loaded via Pylint's configuration, not directly imported into Python code. Add 'pylint_per_file_ignores' to the 'load-plugins' list in your Pylint configuration file.
from pylint_per_file_ignores import some_function
The plugin extends Pylint's functionality at runtime through configuration, it does not expose Python symbols for direct import into user scripts.

To quickly enable `pylint-per-file-ignores`, first install it, then add `pylint_per_file_ignores` to the `load-plugins` section of your Pylint configuration (e.g., `pyproject.toml`, `.pylintrc`, or `setup.cfg`). Finally, define your file patterns and corresponding ignored message codes under the `per-file-ignores` section. This example uses `pyproject.toml`.

# pyproject.toml [tool.pylint.main] load-plugins = [ "pylint_per_file_ignores", ] [tool.pylint.'messages control'] per-file-ignores = [ "/tests/*:missing-function-docstring,C0115", "/src/legacy_code.py:W0621,W0240,E0001" ]
pylint --version
Debug
Known issues
breakingPrior to version 2.0.0, file patterns used regular expressions. From version 2.0.0 onwards, patterns are matched using globs. Existing configurations from older versions must be reviewed and updated to use glob syntax.
fix
Review all `per-file-ignores` patterns in your Pylint configuration and convert any regex patterns to glob patterns if upgrading to v2.0.0 or newer. For example, a regex `.*_test\.py` might become a glob `*_test.py` or `/tests/*.py`.
affects: <2.0.0
gotchaThe plugin is enabled and configured via Pylint's configuration files (e.g., `pyproject.toml`, `.pylintrc`, `setup.cfg`) by adding it to `load-plugins` and defining rules under `per-file-ignores`. It's not a Python module meant for `import` statements in your code.
fix
Ensure the plugin is activated by correctly adding `pylint_per_file_ignores` to the `load-plugins` list within your chosen Pylint configuration file, and define ignore rules in the designated `per-file-ignores` section.
affects: All
gotchaPylint's native `--ignore` option might not work as expected with directories, especially when Pylint is invoked on individual files (e.g., by pre-commit hooks or IDEs). This plugin specifically addresses per-file/pattern ignoring when `--ignore` falls short.
fix
Leverage `pylint-per-file-ignores` for granular control over file and directory patterns. Ensure your `load-plugins` is correctly configured so the plugin can intercept and apply ignore rules before Pylint processes files.
affects: Pylint < 2.9 (native --ignore limitations)
Upgrade
Version history
3.2.1latest on PyPI · released Apr 3, 2026
Audit
Dependencies
pylintrequiredThis is a plugin for Pylint and requires Pylint to function.
pythonrequiredRequires Python versions >=3.10 and <4 for compatibility.
Agent activity
4 hits · last 30 days
node
4
Resources
pylint-per-file-ignores — pip install pylint-per-file-ignores · libregistry