Skip to content

Commit

Permalink
modernize treefmt configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Jul 8, 2024
1 parent bd22550 commit c57fe2b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions treefmt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -20,10 +20,14 @@
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;
};
};
};
}

0 comments on commit c57fe2b

Please sign in to comment.