noogle/preCommit.nix

41 lines
932 B
Nix
Raw Normal View History

2023-11-23 14:31:33 +03:00
{ self, ... }: {
2023-11-28 19:28:51 +03:00
perSystem =
{ pkgs
, self'
, system
, ...
}:
let
formatters = with pkgs; [
nixfmt
nodePackages.prettier #3.0.0 installed over nixpkgs
rustfmt
];
in
{
checks.pre-commit-check = self.inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
treefmt.enable = true;
statix.enable = true;
};
2023-11-29 23:37:07 +03:00
excludes = [ "indexer/test" ".github" "scripts/data" "test_data" ];
2023-11-28 19:28:51 +03:00
settings = {
2023-11-29 23:37:07 +03:00
statix.ignore = [ "indexer/test" "test_data" ];
2023-11-28 19:28:51 +03:00
nixfmt.width = 80;
treefmt.package = pkgs.writeShellApplication {
name = "treefmt";
runtimeInputs =
[
pkgs.treefmt
]
++ formatters;
text = ''
exec treefmt "$@"
'';
};
};
2023-11-25 19:30:43 +03:00
};
2023-11-23 14:31:33 +03:00
};
}