nix/templates/elixir/nix/checks.nix
Daniel Flanagan f2ea15fa7c
All checks were successful
/ check (push) Successful in 5m10s
Elixir
2024-12-23 19:21:49 -06:00

29 lines
591 B
Nix

{
git-hooks,
pkgs,
...
}: let
hook = {
command,
stages ? ["pre-commit"],
...
}: {
inherit stages;
enable = true;
name = command;
entry = command;
pass_filenames = false;
};
in {
git-hooks = git-hooks.lib.${pkgs.system}.run {
src = ./..;
hooks = {
alejandra.enable = true;
convco.enable = true;
credo = hook {command = "mix credo --strict";};
formatting = hook {command = "mix format --check-formatted";};
dialyzer = hook {command = "mix dialyzer";};
test = hook {command = "mix test";};
};
};
}