Skip to content

Commit

Permalink
Merge pull request #480 from cachix/args-and-exclude-types
Browse files Browse the repository at this point in the history
feat: add `args` and `exclude_types` to hooks
  • Loading branch information
sandydoo authored Aug 7, 2024
2 parents 06939f6 + c22803e commit 866eecb
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion modules/hook.nix
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ in
default = [ ];
};

exclude_types = mkOption {
type = types.listOf types.str;
description =
''
List of file types to exclude. See [Filtering files with types](https://pre-commit.com/#filtering-files-with-types).
'';
default = [ ];
};

pass_filenames = mkOption {
type = types.bool;
description = ''
Expand Down Expand Up @@ -166,12 +175,21 @@ in
if true this hook will run even if there are no matching files.
'';
};

args = mkOption {
type = types.listOf types.str;
description =
''
List of additional parameters to pass to the hook.
'';
default = [ ];
};
};

config = {
raw =
{
inherit (config) name entry language files types types_or pass_filenames fail_fast require_serial stages verbose always_run;
inherit (config) name entry language files types types_or exclude_types pass_filenames fail_fast require_serial stages verbose always_run args;
id = config.name;
exclude = mergeExcludes config.excludes;
};
Expand Down

0 comments on commit 866eecb

Please sign in to comment.