From 1fe5afc78489820f5586a9c90f91358a169604a7 Mon Sep 17 00:00:00 2001 From: Sander Date: Fri, 11 Oct 2024 11:59:28 +0400 Subject: [PATCH] statix: fix broken list option `--ignore` --- modules/hooks.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/hooks.nix b/modules/hooks.nix index 97e10dc7..56ae1265 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -3392,9 +3392,15 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol entry = let inherit (hooks.statix) package settings; + mkOptionName = k: + if builtins.stringLength k == 1 + then "-${k}" + else "--${k}"; options = lib.cli.toGNUCommandLineShell { - mkList = name: value: [ name ] ++ lib.unique value; + # instead of repeating the option name for each element, + # create a single option with a space-separated list of unique values. + mkList = k: v: [ (mkOptionName k) ] ++ lib.unique v; } settings; in