treefmt: update ruff settings

This commit is contained in:
zowoq 2024-07-09 09:54:08 +10:00
parent d5c6b4bfe8
commit ff3821bd05

View file

@ -8,6 +8,8 @@
programs.nixpkgs-fmt.enable = true; programs.nixpkgs-fmt.enable = true;
programs.shellcheck.enable = true; programs.shellcheck.enable = true;
programs.deno.enable = true; programs.deno.enable = true;
programs.ruff.check = true;
programs.ruff.format = true;
settings.formatter.shellcheck.options = [ "-s" "bash" ]; settings.formatter.shellcheck.options = [ "-s" "bash" ];
programs.mypy = { programs.mypy = {
@ -16,18 +18,9 @@
pkgs.python3.pkgs.twisted pkgs.python3.pkgs.twisted
]; ];
}; };
settings.formatter.python = {
command = "sh"; settings.formatter.ruff-check.priority = 1;
options = [ settings.formatter.ruff-format.priority = 2;
"-eucx"
''
${pkgs.ruff}/bin/ruff --fix "$@"
${pkgs.ruff}/bin/ruff format "$@"
''
"--" # this argument is ignored by bash
];
includes = [ "*.py" ];
};
}; };
}; };
} }