Pylint Plugin Utilities (version 0.9.0) provides a collection of helper functions and classes designed to simplify the development of custom Pylint checkers and transformers. It abstracts away common boilerplate and provides tools for AST manipulation and message suppression. The library maintains a steady release cadence, typically aligning with Pylint's own major versions to ensure compatibility.
pip install pylint-plugin-utilsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a basic Pylint checker using `pylint-plugin-utils` to detect direct calls to `print`. It also shows the use of the `suppress_message` decorator to exempt specific code from Pylint's default checks. The `register` function is the standard entry point for Pylint plugins.
Ensure your `Pylint` installation is version 2.16 or newer. Upgrade `Pylint` using `pip install --upgrade pylint`.
This function was deprecated in 0.8.0. Plugins should use the standard `register(linter)` function in their module, and within it, call `linter.register_checker()` or similar methods directly.
This function was primarily used for older Pylint setups to manipulate `sys.path`. Ensure your plugin's dependencies are correctly available on `PYTHONPATH` or use Pylint's `--init-hook` option for path manipulation if necessary.
To enable a plugin, Pylint must be invoked with `--load-plugins=your_plugin_module`. For more persistent configuration, define plugins in your `pyproject.toml` or `.pylintrc` file under the `[MASTER]` section using the `load-plugins` option.