nixpkgs-fmt icon indicating copy to clipboard operation
nixpkgs-fmt copied to clipboard

Space removed before comments in multi-line inherit expressions

Open KornelJahn opened this issue 2 years ago • 1 comments

Multi-line inherit constructs with comments, such as

environment.systemPackages = builtins.attrValues {
  inherit (pkgs)
    foo # foo
    bar # bar
    ;
};

are re-formatted as

environment.systemPackages = builtins.attrValues {
  inherit (pkgs)
    foo# foo
    bar# bar
    ;
};

I would expect nixpkgs-fmt to leave the such constructs intact, similarly to the original with-antipattern

environment.systemPackages = with pkgs; [
  foo # foo
  bar # bar
];

they intend to replace.

> nixpkgs-fmt --version
nixpkgs-fmt 1.3.0

KornelJahn avatar Feb 20 '23 06:02 KornelJahn

Any update regarding this issue?

testfailed avatar Mar 12 '24 12:03 testfailed