From 8ab27a131e6f066e56712ac01e33ac62a111c03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valter=20Sch=C3=BCtz?= Date: Sat, 30 Aug 2025 12:15:38 +0200 Subject: [PATCH] languages/python: add formatter that combines `ruff format` with `ruff check --fix` (#1072) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * languages/python: add formatting option for `ruff check --fix` * docs: remove unrelated changes --------- Co-authored-by: Valter Schütz Co-authored-by: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> --- docs/release-notes/rl-0.8.md | 6 ++++++ modules/plugins/languages/python.nix | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index f047d72b..eb46e7e1 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -528,6 +528,12 @@ - Fixed `typescript` treesitter grammar not being included by default. +[valterschutz](https://github.com/valterschutz): + +[ruff]: (https://github.com/astral-sh/ruff) + +- Add [ruff-fix] as a formatter option in `vim.languages.python.format.type`. + [gmvar](https://github.com/gmvar): [harper-ls]: https://github.com/Automattic/harper diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index 6f97f70c..f4d749f4 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -149,6 +149,16 @@ ''; }; }; + + ruff-check = { + package = pkgs.writeShellApplication { + name = "ruff-check"; + runtimeInputs = [pkgs.ruff]; + text = '' + ruff check --fix --exit-zero - + ''; + }; + }; }; defaultDebugger = "debugpy";