buildbot-nix/nix/treefmt/flake-module.nix

34 lines
822 B
Nix
Raw Normal View History

2023-09-18 13:14:45 +00:00
{ inputs, ... }: {
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem = { pkgs, ... }: {
2023-09-18 13:14:45 +00:00
treefmt = {
projectRootFile = ".git/config";
programs.nixpkgs-fmt.enable = true;
programs.shellcheck.enable = true;
programs.deno.enable = true;
settings.formatter.shellcheck.options = [ "-s" "bash" ];
2024-01-01 07:32:22 +00:00
programs.mypy = {
enable = true;
directories.".".extraPythonPackages = [
pkgs.python3.pkgs.twisted
];
};
2023-09-18 13:14:45 +00:00
settings.formatter.python = {
command = "sh";
options = [
"-eucx"
''
${pkgs.ruff}/bin/ruff --fix "$@"
2023-11-18 07:32:03 +00:00
${pkgs.ruff}/bin/ruff format "$@"
2023-09-18 13:14:45 +00:00
''
"--" # this argument is ignored by bash
];
includes = [ "*.py" ];
};
};
};
}