infra/dev/treefmt.nix

73 lines
1.4 KiB
Nix
Raw Normal View History

2024-07-24 19:05:26 +10:00
{ 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
programs = {
actionlint.enable = true;
deadnix.enable = true;
2024-07-24 19:00:54 +10:00
nixfmt.enable = true;
prettier.enable = true;
2024-08-30 15:19:32 +10:00
ruff-check.enable = true;
ruff-format.enable = true;
2024-09-17 12:08:32 +10:00
shellcheck.enable = true;
shfmt.enable = true;
statix.enable = true;
terraform.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 = {
editorconfig-checker = {
command = pkgs.editorconfig-checker;
includes = [ "*" ];
priority = 9; # last
2024-05-05 17:30:05 +10:00
};
2024-09-17 12:08:32 +10:00
shellcheck.priority = 1;
shfmt.priority = 2;
# nix
deadnix.priority = 1;
statix.priority = 2;
2024-07-24 19:00:54 +10:00
nixfmt.priority = 3;
# python
ruff-check.priority = 1;
ruff-format.priority = 2;
mypy-tasks.priority = 3;
2022-12-31 07:18:49 +01:00
prettier = {
2023-08-08 08:56:46 +10:00
options = [
"--prose-wrap"
"never"
];
excludes = [
"config.yaml"
"docs/sponsors.md"
"*secrets.yaml"
2024-12-16 08:34:56 +10:00
"modules/secrets/*.yaml"
];
2022-12-31 07:18:49 +01:00
};
};
}