Skip to content

Commit 1fe5afc

Browse files
committed
statix: fix broken list option --ignore
1 parent 4ebefca commit 1fe5afc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/hooks.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3392,9 +3392,15 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
33923392
entry =
33933393
let
33943394
inherit (hooks.statix) package settings;
3395+
mkOptionName = k:
3396+
if builtins.stringLength k == 1
3397+
then "-${k}"
3398+
else "--${k}";
33953399
options = lib.cli.toGNUCommandLineShell
33963400
{
3397-
mkList = name: value: [ name ] ++ lib.unique value;
3401+
# instead of repeating the option name for each element,
3402+
# create a single option with a space-separated list of unique values.
3403+
mkList = k: v: [ (mkOptionName k) ] ++ lib.unique v;
33983404
}
33993405
settings;
34003406
in

0 commit comments

Comments
 (0)