Skip to content

Commit

Permalink
options: add fail_fast and require_serial
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Feb 22, 2023
1 parent ab60839 commit f15232b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
32 changes: 12 additions & 20 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -786,11 +786,9 @@ in
'';
in
builtins.toString script;
raw = {
# to avoid multiple invocations of the same directory input, provide
# all file names in a single run.
require_serial = true;
};
# to avoid multiple invocations of the same directory input, provide
# all file names in a single run.
require_serial = true;
files = "\\.go$";
};

Expand Down Expand Up @@ -830,11 +828,9 @@ in
in
builtins.toString script;
files = "\\.go$";
raw = {
# to avoid multiple invocations of the same directory input, provide
# all file names in a single run.
require_serial = true;
};
# to avoid multiple invocations of the same directory input, provide
# all file names in a single run.
require_serial = true;
};

gofmt =
Expand Down Expand Up @@ -886,11 +882,9 @@ in
in
builtins.toString script;
files = "\\.go$";
raw = {
# to avoid multiple invocations of the same directory input, provide
# all file names in a single run.
require_serial = true;
};
# to avoid multiple invocations of the same directory input, provide
# all file names in a single run.
require_serial = true;
};

staticcheck =
Expand All @@ -914,11 +908,9 @@ in
in
builtins.toString script;
files = "\\.go$";
raw = {
# to avoid multiple invocations of the same directory input, provide
# all file names in a single run.
require_serial = true;
};
# to avoid multiple invocations of the same directory input, provide
# all file names in a single run.
require_serial = true;
};

editorconfig-checker =
Expand Down
12 changes: 12 additions & 0 deletions modules/pre-commit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ let
'';
default = true;
};
fail_fast = mkOption {
type = types.bool;
description = lib.mdDoc ''
if true pre-commit will stop running hooks if this hook fails.
'';
};
require_serial = mkOption {
type = types.bool;
description = lib.mdDoc ''
if true this hook will execute using a single process instead of in parallel.
'';
};
stages =
mkOption {
type = types.listOf types.str;
Expand Down

0 comments on commit f15232b

Please sign in to comment.