diff --git a/src/Nixfmt/Pretty.hs b/src/Nixfmt/Pretty.hs index d86a4037..110dfb38 100644 --- a/src/Nixfmt/Pretty.hs +++ b/src/Nixfmt/Pretty.hs @@ -206,11 +206,11 @@ prettyTerm (List (Ann leading paropen Nothing) (Items []) (Ann [] parclose trail prettyTerm (List paropen@(Ann _ _ Nothing) (Items [item@(CommentedItem iComment item')]) parclose@(Ann [] _ _)) = base $ group $ pretty paropen <> - (if isAbsorbable item' && null iComment then - surroundWith hardspace item' - else - surroundWith line $ nest 2 item - ) + --(if isAbsorbable item' && null iComment then + -- surroundWith hardspace item' + --else + (surroundWith line $ nest 2 item) + --) <> pretty parclose -- General list (len >= 2) diff --git a/test/diff/idioms_lib_4/out.nix b/test/diff/idioms_lib_4/out.nix index d4b670a9..e8bdec00 100644 --- a/test/diff/idioms_lib_4/out.nix +++ b/test/diff/idioms_lib_4/out.nix @@ -641,12 +641,14 @@ rec { androideabi = { }; android = { - assertions = [ { - assertion = platform: !platform.isAarch32; - message = '' - The "android" ABI is not for 32-bit ARM. Use "androideabi" instead. - ''; - } ]; + assertions = [ + { + assertion = platform: !platform.isAarch32; + message = '' + The "android" ABI is not for 32-bit ARM. Use "androideabi" instead. + ''; + } + ]; }; gnueabi = { diff --git a/test/diff/idioms_lib_5/out.nix b/test/diff/idioms_lib_5/out.nix index 62189229..33c80ba2 100644 --- a/test/diff/idioms_lib_5/out.nix +++ b/test/diff/idioms_lib_5/out.nix @@ -317,10 +317,12 @@ let typeCheck = type: value: let - merged = lib.mergeDefinitions [ ] type [ { - file = lib.unknownModule; - inherit value; - } ]; + merged = lib.mergeDefinitions [ ] type [ + { + file = lib.unknownModule; + inherit value; + } + ]; eval = builtins.tryEval (builtins.deepSeq merged.mergedValue null); in eval.success; diff --git a/test/diff/idioms_nixos_2/out.nix b/test/diff/idioms_nixos_2/out.nix index d1baf0ef..2baaeef3 100644 --- a/test/diff/idioms_nixos_2/out.nix +++ b/test/diff/idioms_nixos_2/out.nix @@ -828,10 +828,12 @@ in } { - assertions = [ { - assertion = cfg.database.createLocally -> cfg.config.dbtype == "mysql"; - message = "services.nextcloud.config.dbtype must be set to mysql if services.nextcloud.database.createLocally is set to true."; - } ]; + assertions = [ + { + assertion = cfg.database.createLocally -> cfg.config.dbtype == "mysql"; + message = "services.nextcloud.config.dbtype must be set to mysql if services.nextcloud.database.createLocally is set to true."; + } + ]; } { @@ -1154,12 +1156,14 @@ in enable = true; package = lib.mkDefault pkgs.mariadb; ensureDatabases = [ cfg.config.dbname ]; - ensureUsers = [ { - name = cfg.config.dbuser; - ensurePermissions = { - "${cfg.config.dbname}.*" = "ALL PRIVILEGES"; - }; - } ]; + ensureUsers = [ + { + name = cfg.config.dbuser; + ensurePermissions = { + "${cfg.config.dbname}.*" = "ALL PRIVILEGES"; + }; + } + ]; initialScript = pkgs.writeText "mysql-init" '' CREATE USER '${cfg.config.dbname}'@'localhost' IDENTIFIED BY '${ builtins.readFile (cfg.config.dbpassFile) diff --git a/test/diff/lists/out.nix b/test/diff/lists/out.nix index b8dec391..75ffcf4d 100644 --- a/test/diff/lists/out.nix +++ b/test/diff/lists/out.nix @@ -1,9 +1,11 @@ [ - [ { - # multiline - foo = "bar"; - foo2 = "barbar"; - } ] + [ + { + # multiline + foo = "bar"; + foo2 = "barbar"; + } + ] [ ( if foo then @@ -72,14 +74,20 @@ # e ] - [ [ - multi - line - ] ] + [ + [ + multi + line + ] + ] [ [ [ singleton ] ] ] [ [ [ { } ] ] ] - [ [ [ - { } - multiline - ] ] ] + [ + [ + [ + { } + multiline + ] + ] + ] ] diff --git a/test/diff/paren/out.nix b/test/diff/paren/out.nix index ba7e2b0c..02cce54f 100644 --- a/test/diff/paren/out.nix +++ b/test/diff/paren/out.nix @@ -1,11 +1,13 @@ [ ( done - // listToAttrs [ { - # multline - name = entry; - value = 1; - } ] + // listToAttrs [ + { + # multline + name = entry; + value = 1; + } + ] ) ] (