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 0bce18a commit cf48c8cCopy full SHA for cf48c8c
flake.nix
@@ -25,7 +25,7 @@
25
inputs.treefmt-nix.flakeModule
26
];
27
28
- perSystem = { config, ... }: {
+ perSystem = { config, pkgs, lib, ... }: {
29
treefmt = {
30
projectRootFile = "flake.nix";
31
programs.mdsh.enable = true;
@@ -35,6 +35,18 @@
35
programs.prettier.enable = true;
36
settings.formatter.prettier.options = [ "--prose-wrap" "always" ];
37
settings.formatter.shellcheck.options = [ "-s" "bash" ];
38
+ settings.formatter.python = {
39
+ command = "sh";
40
+ options = [
41
+ "-eucx"
42
+ ''
43
+ ${lib.getExe pkgs.ruff} --fix "$@"
44
+ ${lib.getExe pkgs.black} "$@"
45
46
+ "--" # this argument is ignored by bash
47
+ ];
48
+ includes = [ "*.py" ];
49
+ };
50
};
51
formatter = config.treefmt.build.wrapper;
52
0 commit comments