From dcb9b16f81f6b766e0219bbef58c207240d01c6f Mon Sep 17 00:00:00 2001 From: Thales Menato <8753631+thamenato@users.noreply.github.com> Date: Tue, 14 Jan 2025 21:03:03 -0500 Subject: [PATCH 1/4] feat: add ruff to formatters --- modules/plugins/languages/python.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index 61aedcee..876093c0 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -106,6 +106,18 @@ ) ''; }; + + ruff = { + package = pkgs.ruff; + nullConfig = '' + table.insert( + ls_sources, + null_ls.builtins.formatting.ruff.with({ + command = "${cfg.format.package}/bin/ruff", + }) + ) + ''; + }; }; defaultDebugger = "debugpy"; From ecf832681c79e9852b474cfa270c1f8d06891959 Mon Sep 17 00:00:00 2001 From: Thales Menato <8753631+thamenato@users.noreply.github.com> Date: Tue, 14 Jan 2025 21:23:11 -0500 Subject: [PATCH 2/4] fix: ruff command feat: add ruff ruff --- modules/plugins/languages/python.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index 876093c0..a36e174f 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -108,7 +108,13 @@ }; ruff = { - package = pkgs.ruff; + package = pkgs.writeShellApplication { + name = "ruff"; + runtimeInputs = [pkgs.ruff]; + text = '' + ruff format - + ''; + }; nullConfig = '' table.insert( ls_sources, From 3f43edd635f688a541fe230b7fcc38580a6bb6b1 Mon Sep 17 00:00:00 2001 From: Thales Menato <8753631+thamenato@users.noreply.github.com> Date: Wed, 15 Jan 2025 07:24:04 -0500 Subject: [PATCH 3/4] fix: run nix fmt --- modules/plugins/languages/python.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index a36e174f..0a3c6c8a 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -109,7 +109,7 @@ ruff = { package = pkgs.writeShellApplication { - name = "ruff"; + name = "ruff"; runtimeInputs = [pkgs.ruff]; text = '' ruff format - From f6d249d0768b62bba332e1866f5b1ed4b7b46220 Mon Sep 17 00:00:00 2001 From: Thales Menato <8753631+thamenato@users.noreply.github.com> Date: Wed, 15 Jan 2025 07:33:27 -0500 Subject: [PATCH 4/4] docs: update changelog --- docs/release-notes/rl-0.8.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index d15c6842..edb3e7b3 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -41,8 +41,8 @@ [horriblename](https://github.com/horriblename): -[aerial.nvim](https://github.com/stevearc/aerial.nvim) -[nvim-ufo](https://github.com/kevinhwang91/nvim-ufo) +[aerial.nvim]: (https://github.com/stevearc/aerial.nvim) +[nvim-ufo]: (https://github.com/kevinhwang91/nvim-ufo) - Add [aerial.nvim] - Add [nvim-ufo] @@ -52,7 +52,8 @@ - Remove `vim.notes.obsidian.setupOpts.dir`, which was set by default. Fixes issue with setting the workspace directory. - Add `vim.snippets.luasnip.setupOpts`, which was previously missing. -- Add `"prettierd"` as a formatter option in `vim.languages.markdown.format.type`. +- Add `"prettierd"` as a formatter option in + `vim.languages.markdown.format.type`. [kaktu5](https://github.com/kaktu5): @@ -63,3 +64,9 @@ [solargraph]: https://github.com/castwide/solargraph - Add Ruby support under `vim.languages.ruby` using [solargraph]. + +[thamenato](https://github.com/thamenato): + +[ruff]: (https://github.com/astral-sh/ruff) + +- Add [ruff] as a formatter option in `vim.languages.python.format.type`.