From 7c1b26b4efe0ae2dfb60672302aaa126ccd5f2ab Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 17 Sep 2024 22:46:42 +0200 Subject: [PATCH] Remove list item count restriction --- src/Nixfmt/Pretty.hs | 2 +- test/diff/idioms_lib_4/out-pure.nix | 8 +------- test/diff/idioms_lib_4/out.nix | 8 +------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Nixfmt/Pretty.hs b/src/Nixfmt/Pretty.hs index 9a276de..5403791 100644 --- a/src/Nixfmt/Pretty.hs +++ b/src/Nixfmt/Pretty.hs @@ -389,7 +389,7 @@ prettyApp indentFunction pre hasPost f a = | indentFunction && null comment' = nest $ group' RegularG $ line' <> pretty expr | otherwise = pretty expr - isSimpleItems items = length (unItems items) <= 4 && all (isSimple . Term) items + isSimpleItems items = all (isSimple . Term) items -- Render the inner arguments of a function call absorbInner :: Expression -> Doc diff --git a/test/diff/idioms_lib_4/out-pure.nix b/test/diff/idioms_lib_4/out-pure.nix index a324a48..a50f10c 100644 --- a/test/diff/idioms_lib_4/out-pure.nix +++ b/test/diff/idioms_lib_4/out-pure.nix @@ -782,13 +782,7 @@ rec { # cpu-vendor-os else if elemAt l 1 == "apple" - || elem (elemAt l 2) [ - "wasi" - "redox" - "mmixware" - "ghcjs" - "mingw32" - ] + || elem (elemAt l 2) [ "wasi" "redox" "mmixware" "ghcjs" "mingw32" ] || hasPrefix "freebsd" (elemAt l 2) || hasPrefix "netbsd" (elemAt l 2) || hasPrefix "genode" (elemAt l 2) diff --git a/test/diff/idioms_lib_4/out.nix b/test/diff/idioms_lib_4/out.nix index a324a48..a50f10c 100644 --- a/test/diff/idioms_lib_4/out.nix +++ b/test/diff/idioms_lib_4/out.nix @@ -782,13 +782,7 @@ rec { # cpu-vendor-os else if elemAt l 1 == "apple" - || elem (elemAt l 2) [ - "wasi" - "redox" - "mmixware" - "ghcjs" - "mingw32" - ] + || elem (elemAt l 2) [ "wasi" "redox" "mmixware" "ghcjs" "mingw32" ] || hasPrefix "freebsd" (elemAt l 2) || hasPrefix "netbsd" (elemAt l 2) || hasPrefix "genode" (elemAt l 2)