Skip to content

Commit 4ebefca

Browse files
authored
Merge pull request #503 from sivizius/extend-statix
feat(statix): add settings
2 parents 1211305 + 7ee593e commit 4ebefca

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

modules/hooks.nix

+25-2
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,13 @@ in
14211421
type = types.submodule {
14221422
imports = [ hookModule ];
14231423
options.settings = {
1424+
config =
1425+
mkOption {
1426+
type = types.nullOr types.str;
1427+
description = "Path to statix.toml or its parent directory.";
1428+
default = null;
1429+
};
1430+
14241431
format =
14251432
mkOption {
14261433
type = types.enum [ "stderr" "errfmt" "json" ];
@@ -1435,6 +1442,14 @@ in
14351442
default = [ ];
14361443
example = [ "flake.nix" "_*" ];
14371444
};
1445+
1446+
unrestricted =
1447+
mkOption {
1448+
type = types.bool;
1449+
description = "Don't respect .gitignore files.";
1450+
default = false;
1451+
example = true;
1452+
};
14381453
};
14391454
};
14401455
};
@@ -3374,8 +3389,16 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
33743389
name = "statix";
33753390
description = "Lints and suggestions for the Nix programming language.";
33763391
package = tools.statix;
3377-
entry = with hooks.statix.settings;
3378-
"${hooks.statix.package}/bin/statix check -o ${format} ${if (ignore != [ ]) then "-i ${lib.escapeShellArgs (lib.unique ignore)}" else ""}";
3392+
entry =
3393+
let
3394+
inherit (hooks.statix) package settings;
3395+
options = lib.cli.toGNUCommandLineShell
3396+
{
3397+
mkList = name: value: [ name ] ++ lib.unique value;
3398+
}
3399+
settings;
3400+
in
3401+
"${package}/bin/statix check ${options}";
33793402
files = "\\.nix$";
33803403
pass_filenames = false;
33813404
};

0 commit comments

Comments
 (0)