From d09c54582dacdc03ec2a7c69a69f1dbfe2e28750 Mon Sep 17 00:00:00 2001 From: "Radu C. Martin" Date: Mon, 24 Feb 2025 15:28:30 +0100 Subject: [PATCH] feat(python): use ruff as lsp --- lua/plugins/conform.lua | 9 ++++++++- lua/plugins/lsp.lua | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index f367253..55ec19a 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -35,7 +35,14 @@ return { lua = { 'stylua' }, -- cs = { 'csharpier' }, -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, + python = { + -- To fix auto-fixable lint errors. + 'ruff_fix', + -- To run the Ruff formatter. + 'ruff_format', + -- To organize the imports. + 'ruff_organize_imports', + }, -- -- You can use 'stop_after_first' to run the first available formatter from the list -- javascript = { "prettierd", "prettier", stop_after_first = true }, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index dbd1f6b..ff7f246 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -182,7 +182,7 @@ return { local servers = { -- clangd = {}, -- gopls = {}, - pyright = {}, + ruff = {}, rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs --