From ff3821bd05aa7819384cb126011f868594dc6a09 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Tue, 9 Jul 2024 09:54:08 +1000 Subject: [PATCH] treefmt: update ruff settings --- nix/treefmt/flake-module.nix | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/nix/treefmt/flake-module.nix b/nix/treefmt/flake-module.nix index 4aef50e..5c82312 100644 --- a/nix/treefmt/flake-module.nix +++ b/nix/treefmt/flake-module.nix @@ -8,6 +8,8 @@ programs.nixpkgs-fmt.enable = true; programs.shellcheck.enable = true; programs.deno.enable = true; + programs.ruff.check = true; + programs.ruff.format = true; settings.formatter.shellcheck.options = [ "-s" "bash" ]; programs.mypy = { @@ -16,18 +18,9 @@ pkgs.python3.pkgs.twisted ]; }; - settings.formatter.python = { - command = "sh"; - options = [ - "-eucx" - '' - ${pkgs.ruff}/bin/ruff --fix "$@" - ${pkgs.ruff}/bin/ruff format "$@" - '' - "--" # this argument is ignored by bash - ]; - includes = [ "*.py" ]; - }; + + settings.formatter.ruff-check.priority = 1; + settings.formatter.ruff-format.priority = 2; }; }; }