Add treefmt configuration

This commit is contained in:
Fabian Hauser 2025-03-25 13:56:52 +02:00
parent ff0ce9d94c
commit b2395ce611
5 changed files with 158 additions and 31 deletions

30
treefmt.nix Normal file
View file

@ -0,0 +1,30 @@
{ ... }:
{
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
deadnix.enable = true;
jsonfmt.enable = true;
yamlfmt.enable = true;
mdformat.enable = true;
ruff-check.enable = true;
ruff-format.enable = true;
shfmt.enable = true;
};
settings = {
global.excludes =
[
"*.jpg"
"*.pdf"
"*.toml"
]
++ [
".envrc"
"robots.txt"
".vscode/*"
"nixos-modules/system/etc/*"
"private/*"
];
formatter.jsonfmt.excludes = [ ".vscode/*.json" ];
};
}