1
0
Fork 0

Clean up pre-commit opt-out mechanism

This commit is contained in:
Nicolas Jeannerod 2025-02-25 17:05:45 +01:00
parent 4e30363c5f
commit 44a69fb376
Signed by untrusted user: Niols
GPG key ID: 35DB9EC8886E1CB8

View file

@ -33,6 +33,7 @@
{
config,
pkgs,
lib,
inputs',
...
}:
@ -44,20 +45,12 @@
## Add a directory here if pre-commit hooks shouldn't apply to it.
optout = [ "npins" ];
excludes = map (dir: "^${dir}/") optout;
addExcludes = lib.mapAttrs (_: c: c // { inherit excludes; });
in
{
nixfmt-rfc-style = {
enable = true;
inherit excludes;
};
deadnix = {
enable = true;
inherit excludes;
};
trim-trailing-whitespace = {
enable = true;
inherit excludes;
};
addExcludes {
nixfmt-rfc-style.enable = true;
deadnix.enable = true;
trim-trailing-whitespace.enable = true;
};
devShells.default = pkgs.mkShell {