From 85c0974e5594684357a500a6fd9977b865658648 Mon Sep 17 00:00:00 2001 From: Martijn Kruiten Date: Tue, 7 Nov 2023 15:58:50 +0100 Subject: [PATCH] Add ruff-format formatter in extras --- .../plugins/extras/formatting/ruff_format.lua | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/formatting/ruff_format.lua diff --git a/lua/lazyvim/plugins/extras/formatting/ruff_format.lua b/lua/lazyvim/plugins/extras/formatting/ruff_format.lua new file mode 100644 index 00000000..e5832105 --- /dev/null +++ b/lua/lazyvim/plugins/extras/formatting/ruff_format.lua @@ -0,0 +1,26 @@ +return { + { + "williamboman/mason.nvim", + opts = function(_, opts) + table.insert(opts.ensure_installed, "ruff") + end, + }, + { + "nvimtools/none-ls.nvim", + optional = true, + opts = function(_, opts) + local nls = require("null-ls") + opts.sources = opts.sources or {} + table.insert(opts.sources, nls.builtins.formatting.ruff_format) + end, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + ["python"] = { "ruff_format" }, + }, + }, + }, +}