Skip to content

Commit 222d550

Browse files
committed
feat(convco): add option configPath
1 parent 9c52372 commit 222d550

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

modules/hooks.nix

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,20 @@ in
290290
};
291291
};
292292
};
293+
convco = mkOption {
294+
description = "convco hook";
295+
type = types.submodule {
296+
imports = [ hookModule ];
297+
options.settings = {
298+
configPath =
299+
mkOption {
300+
type = types.nullOr (types.oneOf [ types.str types.path ]);
301+
description = "Path to the configuration file (YAML or JSON)";
302+
default = null;
303+
};
304+
};
305+
};
306+
};
293307
credo = mkOption {
294308
description = "credo hook";
295309
type = types.submodule {
@@ -2462,9 +2476,13 @@ in
24622476
package = tools.convco;
24632477
entry =
24642478
let
2479+
cmdArgs =
2480+
mkCmdArgs (with hooks.convco.settings; [
2481+
[ (configPath != null) "--config ${configPath}" ]
2482+
]);
24652483
convco = hooks.convco.package;
24662484
script = pkgs.writeShellScript "precommit-convco" ''
2467-
cat $1 | ${convco}/bin/convco check --from-stdin
2485+
cat $1 | ${convco}/bin/convco check --from-stdin ${cmdArgs}
24682486
'';
24692487
# need version >= 0.4.0 for the --from-stdin flag
24702488
toolVersionCheck = lib.versionAtLeast convco.version "0.4.0";

0 commit comments

Comments
 (0)