We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bf2cd3 commit 65b4eb0Copy full SHA for 65b4eb0
treefmt/flake-module.nix
@@ -2,7 +2,7 @@
2
imports = [
3
inputs.treefmt-nix.flakeModule
4
];
5
- perSystem = { config, ... }: {
+ perSystem = { config, lib, pkgs, ... }: {
6
treefmt = {
7
projectRootFile = "flake.nix";
8
programs.mdsh.enable = true;
@@ -11,6 +11,18 @@
11
programs.shfmt.enable = true;
12
programs.deno.enable = true;
13
settings.formatter.shellcheck.options = [ "-s" "bash" ];
14
+ settings.formatter.python = {
15
+ command = "sh";
16
+ options = [
17
+ "-eucx"
18
+ ''
19
+ ${lib.getExe pkgs.ruff} --fix "$@"
20
+ ${lib.getExe pkgs.ruff} "fmt" "$@"
21
22
+ "--" # this argument is ignored by bash
23
+ ];
24
+ includes = [ "*.py" ];
25
+ };
26
};
27
formatter = config.treefmt.build.wrapper;
28
0 commit comments