modernize treefmt configuration

This commit is contained in:
Jörg Thalheim 2024-07-08 12:55:14 +02:00
parent bd2255044c
commit c57fe2b791

View file

@ -3,10 +3,10 @@
inputs.treefmt-nix.flakeModule
];
perSystem = _: {
perSystem = {
treefmt = {
# Used to find the project root
projectRootFile = "flake.lock";
projectRootFile = ".git/config";
programs = {
deadnix.enable = true;
@ -20,9 +20,13 @@
statix.enable = true;
};
settings.formatter = {
shellcheck.includes = [ "*.sh" "direnvrc" ];
shfmt.includes = [ "*.sh" "direnvrc" ];
settings.formatter =
let
shellIncludes = [ "*.sh" "direnvrc" ];
in
{
shellcheck.includes = shellIncludes;
shfmt.includes = shellIncludes;
};
};
};