Ruff linting plugin for pylsp
Maintained. Last release 3 months ago, commits in 3 of the last 26 weeks. Weaker on commit activity.
pip install python-lsp-ruffpython-lsp-ruff
python-lsp-ruff is a plugin for python-lsp-server that adds linting, code actions and formatting capabilities that are provided by ruff,
an extremely fast Python linter and formatter written in Rust.
Note that ruff>0.4.5 ships with a built-in LSP server (and ruff-lsp before that), which allows linting, formatting and code actions.
In contrast, this implementation adds ruff as a plugin for pylsp in addition to pylsp's other functionalities (go-to support, ...).
Install
In the same virtualenv as python-lsp-server:
pip install python-lsp-ruff
There also exists an AUR package.
When using ruff before version 0.1.0
Ruff version 0.1.0 introduced API changes that are fixed in Python LSP Ruff v1.6.0. To continue with ruff<0.1.0 please use v1.5.3, e.g. using pip:
pip install "ruff<0.1.0" "python-lsp-ruff==1.5.3"
Usage
This plugin will disable pycodestyle, pyflakes, mccabe, autopep8, and yapf by default, unless they are explicitly enabled in the client configuration.
When python-lsp-ruff is enabled, all linting diagnostics and formatting capabilities will be provided by ruff.
Any codes given in the format option will only be marked as fixable for ruff during the formatting operation, the user has to make sure that these codes are also in the list of codes that ruff checks!