From c031f9787421fa6fbc1042696f2c0bad18dddd83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Tue, 12 Mar 2024 14:16:35 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(nvim):=20add=20new=20extra:=20?= =?UTF-8?q?ruff=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lua/plugins/extras/formatting/ruff.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .config/nvim/lua/plugins/extras/formatting/ruff.lua diff --git a/.config/nvim/lua/plugins/extras/formatting/ruff.lua b/.config/nvim/lua/plugins/extras/formatting/ruff.lua new file mode 100644 index 00000000..781d00d0 --- /dev/null +++ b/.config/nvim/lua/plugins/extras/formatting/ruff.lua @@ -0,0 +1,18 @@ +return { + { + "stevearc/conform.nvim", + opts = function(_, opts) + opts.formatters_by_ft.python = opts.formatters_by_ft.python or {} + table.insert(opts.formatters_by_ft.python, "ruff_format") + table.insert(opts.formatters_by_ft.python, "ruff_fix") + return opts + end, + }, + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "ruff" }) + end, + }, +}