This is a helper package that automatically installs and updates ruff for you. Ruff is an extremely fast Python linter and code transformation tool, written in Rust.
To use this package, you must have:
- An executable
python
(on Windows) orpython3
(on Linux/macOS) - The LSP package
- For Ubuntu and Debian users, you must also install python3-venv with apt
- It's recommended to also install the LSP-json package which will provide auto-completion and validation for this package's settings.
There are multiple ways to configure the package and the language server.
-
Global configuration:
Preferences > Package Settings > LSP > Servers > LSP-ruff
-
Project-specific configuration: From the Command Palette run
Project: Edit Project
and add your settings in:{ "settings": { "LSP": { "LSP-ruff": { "initializationOptions": { "settings": { // Put your settings here } } } } } }
The following "code actions on save" are supported:
source.fixAll
source.organizeImports
source.fixAll.ruff
source.organizeImports.ruff
You can use those with the lsp_code_actions_on_save
LSP Setting to automatically apply specific actions on saving the file.