forked from clan/clan-core
treefmt: add ruff + black
This commit is contained in:
parent
e4fbb08f91
commit
88295ce77d
@ -1,4 +1,4 @@
|
||||
{ self
|
||||
{ lib
|
||||
, inputs
|
||||
, ...
|
||||
}: {
|
||||
@ -11,5 +11,17 @@
|
||||
treefmt.flakeFormatter = true;
|
||||
treefmt.programs.nixpkgs-fmt.enable = true;
|
||||
treefmt.programs.shellcheck.enable = true;
|
||||
treefmt.settings.formatter.python = {
|
||||
command = "sh";
|
||||
options = [
|
||||
"-eucx"
|
||||
''
|
||||
${lib.getExe pkgs.ruff} --fix "$@"
|
||||
${lib.getExe pkgs.black} "$@"
|
||||
''
|
||||
"--" # this argument is ignored by bash
|
||||
];
|
||||
includes = [ "*.py" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user