Skip to content

Commit

Permalink
Remove list item count restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil committed Sep 17, 2024
1 parent 228f526 commit 7c1b26b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Nixfmt/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions test/diff/idioms_lib_4/out-pure.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 1 addition & 7 deletions test/diff/idioms_lib_4/out.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7c1b26b

Please sign in to comment.