From 022c88b789243d4375e653da34eb2ad6109a2335 Mon Sep 17 00:00:00 2001 From: piegames Date: Thu, 17 Jul 2025 11:46:50 +0200 Subject: [PATCH] Not sure if we want to do this --- src/Nixfmt/Pretty.hs | 6 ++---- test/diff/key_value/out-pure.nix | 12 ++++++------ test/diff/key_value/out.nix | 12 ++++++------ test/diff/pattern/out-pure.nix | 4 ++-- test/diff/pattern/out.nix | 4 ++-- 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/Nixfmt/Pretty.hs b/src/Nixfmt/Pretty.hs index a383446e..76c2a9e9 100644 --- a/src/Nixfmt/Pretty.hs +++ b/src/Nixfmt/Pretty.hs @@ -153,8 +153,7 @@ instance Pretty Binder where pretty (Assignment selectors assign expr semicolon) = group $ hcat selectors - <> nest (hardspace <> pretty assign <> rhs) - <> pretty semicolon + <> nest (hardspace <> pretty assign <> rhs <> nest (pretty semicolon)) where rhs = -- In most cases, the LHS of a binding is fairly short. This means that when the RHS @@ -264,8 +263,7 @@ instance Pretty ParamAttr where group $ pretty name <> hardspace - <> nest (pretty qmark <> absorbRHS def) - <> pretty maybeComma + <> nest (pretty qmark <> absorbRHS def <> nest (pretty maybeComma)) -- `...` pretty (ParamEllipsis ellipsis) = pretty ellipsis diff --git a/test/diff/key_value/out-pure.nix b/test/diff/key_value/out-pure.nix index 1d93de5b..02f71b69 100644 --- a/test/diff/key_value/out-pure.nix +++ b/test/diff/key_value/out-pure.nix @@ -9,7 +9,7 @@ rec { b = { a = 1 # d - ; + ; }; c = { @@ -19,7 +19,7 @@ rec { d = { a = # c 1 # d - ; + ; }; e = { a # b @@ -28,7 +28,7 @@ rec { f = { a # b = 1 # d - ; + ; }; h = { a # b @@ -39,7 +39,7 @@ rec { a # b = # c 1 # d - ; + ; }; j = a: { b = 1; }; k = a: { @@ -63,8 +63,8 @@ rec { = # c 1 - # d - ; + # d + ; p = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa { } a; diff --git a/test/diff/key_value/out.nix b/test/diff/key_value/out.nix index 0ced3361..ceccd3e7 100644 --- a/test/diff/key_value/out.nix +++ b/test/diff/key_value/out.nix @@ -9,7 +9,7 @@ rec { b = { a = 1 # d - ; + ; }; c = { @@ -19,7 +19,7 @@ rec { d = { a = # c 1 # d - ; + ; }; e = { a # b @@ -28,7 +28,7 @@ rec { f = { a # b = 1 # d - ; + ; }; h = { a # b @@ -39,7 +39,7 @@ rec { a # b = # c 1 # d - ; + ; }; j = a: { b = 1; }; k = a: { @@ -68,8 +68,8 @@ rec { = # c 1 - # d - ; + # d + ; p = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa { } a; diff --git a/test/diff/pattern/out-pure.nix b/test/diff/pattern/out-pure.nix index cdac106f..4da78636 100644 --- a/test/diff/pattern/out-pure.nix +++ b/test/diff/pattern/out-pure.nix @@ -646,11 +646,11 @@ b # a ? # a null # c - , # d + , # d e # a ? # a null # f - , # g + , # g ... # h }: _ diff --git a/test/diff/pattern/out.nix b/test/diff/pattern/out.nix index cdac106f..4da78636 100644 --- a/test/diff/pattern/out.nix +++ b/test/diff/pattern/out.nix @@ -646,11 +646,11 @@ b # a ? # a null # c - , # d + , # d e # a ? # a null # f - , # g + , # g ... # h }: _