infra/dev/treefmt.nix

89 lines
1.5 KiB
Nix
Raw Normal View History

{ pkgs, ... }: {
# Used to find the project root
2023-09-20 09:08:21 +10:00
projectRootFile = ".git/config";
2022-12-31 07:18:49 +01:00
package = pkgs.treefmt2;
programs = {
deadnix.enable = true;
hclfmt.enable = true;
nixpkgs-fmt.enable = true;
prettier.enable = true;
ruff.check = true;
ruff.format = true;
statix.enable = true;
};
2022-12-31 07:18:49 +01:00
2023-09-06 11:41:05 +10:00
programs.mypy = {
enable = true;
directories = {
"tasks" = {
directory = ".";
files = [ "*tasks.py" ];
2023-09-06 11:41:05 +10:00
modules = [ ];
extraPythonPackages = [
pkgs.python3.pkgs.deploykit
pkgs.python3.pkgs.invoke
];
};
};
};
settings.global.excludes = [
# vendored from external source
"hosts/build02/packages-with-update-script.nix"
];
2023-03-13 13:23:27 +10:00
settings.formatter = {
actionlint = {
2023-09-15 16:08:20 +10:00
command = pkgs.actionlint;
includes = [ ".github/workflows/*.yml" ];
pipeline = "yaml";
priority = 1;
2023-09-15 16:08:20 +10:00
};
deadnix = {
pipeline = "nix";
priority = 1;
2024-05-05 17:30:05 +10:00
};
statix = {
pipeline = "nix";
priority = 2;
};
2023-04-12 13:24:49 +10:00
nixpkgs-fmt = {
pipeline = "nix";
priority = 3;
};
2023-01-01 21:18:13 +01:00
ruff-check = {
pipeline = "python";
priority = 1;
};
ruff-format = {
pipeline = "python";
priority = 2;
};
mypy-tasks = {
pipeline = "python";
priority = 3;
};
2022-12-31 07:18:49 +01:00
prettier = {
2023-08-08 08:56:46 +10:00
options = [
"--write"
"--prose-wrap"
"never"
];
excludes = [
"*secrets.yaml"
];
pipeline = "yaml";
priority = 2;
2022-12-31 07:18:49 +01:00
};
};
}