Skip to content

Commit e9770be

Browse files
committed
Remove "Case 1"
1 parent d251ac8 commit e9770be

File tree

5 files changed

+12
-18
lines changed

5 files changed

+12
-18
lines changed

src/Nixfmt/Pretty.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,13 +636,6 @@ absorbRHS expr = case expr of
636636
(With{}) -> nest $ group' RegularG $ line <> pretty expr
637637
-- Special case `//` and `++` operations to be more compact in some cases
638638
-- Case 1: two arguments, LHS is absorbable term, RHS fits onto the last line
639-
(Operation (Term t) (LoneAnn op) b)
640-
| isAbsorbable t
641-
&& isUpdateOrConcat op
642-
-- Exclude further operations on the RHS
643-
-- Hotfix for https://github.com/NixOS/nixfmt/issues/198
644-
&& case b of (Operation{}) -> False; _ -> True ->
645-
hardspace <> (prettyTermWide t) <> group' RegularG (line <> pretty op <> hardspace <> pretty b)
646639
-- Unindent concatenations
647640
-- https://github.com/NixOS/nixfmt/issues/228
648641
(Operation (Term t) op@(Ann{value}) _)

test/diff/attr_set/out-pure.nix

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,16 +414,15 @@
414414
list
415415
];
416416
some.long.attribute # with a comment
417-
= [
418-
stuff
419-
] ++ more stuff;
417+
= [ stuff ] ++ more stuff;
420418
some.long.attribute1 # with a comment
421419
= [
422420
stuff
423421
a
424422
b
425423
c
426-
] ++ more stuff;
424+
]
425+
++ more stuff;
427426

428427
foo4 # nasty
429428
= # comments

test/diff/attr_set/out.nix

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,16 +431,15 @@
431431
list
432432
];
433433
some.long.attribute # with a comment
434-
= [
435-
stuff
436-
] ++ more stuff;
434+
= [ stuff ] ++ more stuff;
437435
some.long.attribute1 # with a comment
438436
= [
439437
stuff
440438
a
441439
b
442440
c
443-
] ++ more stuff;
441+
]
442+
++ more stuff;
444443

445444
foo4 # nasty
446445
= # comments

test/diff/idioms_pkgs_3/out-pure.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,8 @@ buildStdenv.mkDerivation ({
573573
inherit tests;
574574
inherit gtk3;
575575
inherit wasiSysRoot;
576-
} // extraPassthru;
576+
}
577+
// extraPassthru;
577578

578579
hardeningDisable = [ "format" ]; # -Werror=format-security
579580

test/diff/idioms_pkgs_3/out.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ buildStdenv.mkDerivation ({
239239

240240
outputs = [
241241
"out"
242-
] ++ lib.optionals crashreporterSupport [ "symbols" ];
242+
]
243+
++ lib.optionals crashreporterSupport [ "symbols" ];
243244

244245
# Add another configure-build-profiling run before the final configure phase if we build with pgo
245246
preConfigurePhases = lib.optionals pgoSupport [
@@ -575,7 +576,8 @@ buildStdenv.mkDerivation ({
575576
inherit tests;
576577
inherit gtk3;
577578
inherit wasiSysRoot;
578-
} // extraPassthru;
579+
}
580+
// extraPassthru;
579581

580582
hardeningDisable = [ "format" ]; # -Werror=format-security
581583

0 commit comments

Comments
 (0)