nix-community / nixpkgs-fmt

Nix code formatter for nixpkgs [maintainer=@zimbatm]
https://nix-community.github.io/nixpkgs-fmt/
Apache License 2.0
581 stars 34 forks source link

Space removed before comments in multi-line inherit expressions #305

Open KornelJahn opened 1 year ago

KornelJahn commented 1 year ago

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
testfailed commented 5 months ago

Any update regarding this issue?