Install & Compatibility
Where this runs
tested against v0.14.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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.092s · 19.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.7s · import 0.082s · 20MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
LintMessage
✓ from lintrunner_adapters import LintMessage
✗ from lintrunner_adapters import RuffLinter
LintSeverity
✓ from lintrunner_adapters import LintSeverity
✗ from lintrunner_adapters import RuffLinter
add_default_options
✓ from lintrunner_adapters import add_default_options
✗ from lintrunner_adapters import RuffLinter
This quickstart demonstrates how to configure `lintrunner` to use adapters from `lintrunner-adapters`. You define linters in a `lintrunner.toml` file, specifying the `linter_class` as a string path to the adapter. You must install `lintrunner` and the underlying linters (e.g., `ruff`, `black`) separately. The example creates a `test_file.py` and `lintrunner.toml` locally, and then provides instructions on how to execute `lintrunner` to apply the configured linters.
import os
# 1. Create a sample Python file to lint
python_code = """def foo ( x ):\n return x+1\n"""
with open("test_file.py", "w") as f:
f.write(python_code)
# 2. Create a lintrunner.toml configuration (simulating user setup)
# In a real project, this would be a file named `lintrunner.toml`
lintrunner_toml_content = """
[linter.ruff]
linter_class = "lintrunner_adapters.ruff_linter:RuffLinter"
[linter.black]
linter_class = "lintrunner_adapters.black_linter:BlackLinter"
args = ["--check", "--diff"]
"""
with open("lintrunner.toml", "w") as f:
f.write(lintrunner_toml_content)
# 3. Ensure lintrunner and the linters are installed for this example to run
# In a real setup, `pip install lintrunner ruff black` would be done.
# We can't actually run lintrunner directly in this snippet, but demonstrate setup.
print("Created test_file.py and lintrunner.toml. To run, execute:")
print("pip install lintrunner ruff black")
print("lintrunner --config lintrunner.toml test_file.py")
# Clean up (optional, for standalone execution)
# os.remove("test_file.py")
# os.remove("lintrunner.toml")
Debug
Known issues
gotchaThe `lintrunner-adapters` library itself does not install the underlying linters (e.g., `ruff`, `black`, `pylint`). You must explicitly install each linter that you intend to use via its respective adapter.fixEnsure all linters referenced in your `lintrunner.toml` are installed in your environment (e.g., `pip install ruff black pylint`).
affects: All versions
gotchaBreaking changes in underlying linters (e.g., `ruff`, `black`) can cause adapters to behave unexpectedly or fail. `lintrunner-adapters` updates are typically released to maintain compatibility with new linter versions.fixKeep `lintrunner-adapters` updated to the latest version to ensure compatibility with recent linter releases. Check release notes for specific compatibility information.
affects: All versions
breakingThe `PylintLinter` adapter changed its behavior to raise an error when Pylint fails, instead of failing silently. Scripts or CI pipelines that relied on silent failures might break.fixUpdate any scripts or CI configurations that use the `PylintLinter` to handle explicit errors rather than assuming silent failure. Inspect Pylint output for issues.
affects: >=0.12.2
gotchaThis library requires Python 3.9 or newer. Running with older Python versions will result in installation or runtime errors.fixEnsure your environment is using Python 3.9 or a newer version (e.g., `python3.9 -m pip install lintrunner-adapters`).
affects: <0.12.0 (but >=0.12.0 explicitly requires it)
Upgrade
Version history
0.14.1latest on PyPI · released Jul 13, 2026
Audit
Dependencies
lintrunnerrequiredThis library provides adapters for the lintrunner framework itself.
blackoptionalRequired if you plan to use the Black linter adapter. Each adapter depends on its respective linter.
ruffoptionalRequired if you plan to use the Ruff linter adapter. Each adapter depends on its respective linter.
pylintoptionalRequired if you plan to use the Pylint linter adapter. Each adapter depends on its respective linter.
banditoptionalRequired if you plan to use the Bandit linter adapter. Each adapter depends on its respective linter.
docformatteroptionalRequired if you plan to use the Docformatter linter adapter. Each adapter depends on its respective linter.