Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

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

Open
KornelJahn opened this issue Feb 20, 2023 · 1 comment
Open

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

KornelJahn opened this issue Feb 20, 2023 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@KornelJahn
Copy link

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 KornelJahn added bug Something isn't working needs triage labels Feb 20, 2023
@KornelJahn KornelJahn changed the title Space removed before comments in a multi-line inherit expression Space removed before comments in multi-line inherit expressions Feb 20, 2023
@testfailed
Copy link

testfailed commented Mar 12, 2024

Any update regarding this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants