Registry / testing / python-lsp-ruff

python-lsp-ruff

JSON →
library2.3.1pypypiunverified

python-lsp-ruff is a plugin for python-lsp-server that integrates Ruff's linting, code actions, and formatting capabilities. It leverages Ruff, an extremely fast Python linter and formatter written in Rust, providing a fast and comprehensive code analysis experience. The library is actively maintained, with frequent updates (current version 2.3.1) for bug fixes and compatibility with newer Ruff versions.

pip install python-lsp-server ruff python-lsp-ruff
INSTALL
IMPORT
SIG · PYTHON-LSP-RUFF
P
python-lsp-ruff
testingpythonv2.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

Not directly imported
python-lsp-ruff is a plugin for python-lsp-server and is not imported or used directly in application code. Its functionality is exposed via the Language Server Protocol client (e.g., IDE/editor configuration).

After installing `python-lsp-server`, `ruff`, and `python-lsp-ruff` in the same virtual environment, configure your LSP client (editor/IDE) to enable the Ruff plugin for `python-lsp-server`. This typically involves a JSON-like configuration for the language server. The example above shows how to enable Ruff for linting and formatting, explicitly re-enabling import sorting ('I') due to a breaking change in v2.0.0, and disabling other common Python linters to prevent conflicts. Remember to adjust paths and specific settings (e.g., `target-version`, `select`, `ignore`) according to your `ruff` configuration or `pyproject.toml`.

{ "python": { "linting": { "ruff": { "enabled": true, "config": "/path/to/pyproject.toml" } }, "formatting": { "ruff": { "enabled": true, "format": ["I"] } }, "plugins": { "pycodestyle": {"enabled": false}, "pyflakes": {"enabled": false} } } }
Debug
Known issues
breakingVersion 2.0.0 introduced breaking changes to code formatting. It now uses `ruff format` directly, and the default import sorting was removed.
fix
To enable import sorting, add `format = ['I']` to your `ruff` configuration within your LSP client settings.
affects: >=2.0.0
breakingVersions 2.1.0 and 1.6.0 introduced breaking compatibility requirements with `ruff`. Older `python-lsp-ruff` versions might not work with newer `ruff` versions, and vice-versa.
fix
Ensure that your installed `ruff` version meets the minimum requirement specified by `python-lsp-ruff` (e.g., `ruff>=0.2.0` for `python-lsp-ruff>=2.1.0`). If using an older `ruff` (<0.1.0), you might need to pin `python-lsp-ruff==1.5.3`.
affects: >=1.6.0, >=2.1.0
gotchaRuff itself ships with a built-in LSP server (`ruff-lsp` or `ruff server`) since `ruff>0.4.5`. This can be confused with `python-lsp-ruff`, which is a plugin for `python-lsp-server`. They serve different integration patterns.
fix
Understand your LSP setup: if you use `python-lsp-server` for multiple language features, `python-lsp-ruff` is the correct choice to integrate Ruff. If you primarily want Ruff's features as a standalone LSP, consider `ruff-lsp` directly.
affects: All
gotchaWhen a `pyproject.toml` or `ruff.toml` file is present in your project, `python-lsp-ruff` will often defer to its configuration, ignoring some options passed via `pylsp` settings.
fix
Prioritize configuring Ruff directly in your `pyproject.toml` or `ruff.toml` for project-specific settings to ensure consistent behavior across tools and contributors.
affects: All
gotcha`python-lsp-ruff` disables other linters/formatters (e.g., `pycodestyle`, `pyflakes`, `mccabe`, `autopep8`, `yapf`, `flake8`, `pyls_isort`) by default to avoid duplicate diagnostics.
fix
If you need to use these other tools alongside Ruff, you must explicitly re-enable them in your LSP client's configuration, ensuring no rule conflicts exist.
affects: All
Upgrade
Version history
2.3.1latest on PyPI · released Apr 1, 2026
Audit
Dependencies
python-lsp-serverrequiredThis library is a plugin for python-lsp-server, providing Ruff's functionality within the LSP framework.
ruff>=0.2.0requiredpython-lsp-ruff relies on the Ruff executable for all linting and formatting operations.
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
python-lsp-ruff — pip install python-lsp-ruff · libregistry