nixfmt
nixfmt copied to clipboard
nixfmt keeps moving comments immediately after `in`
Given the expression
let
a = 0;
in
# checking if a == 0
if a == 0 then
"a is zero"
else
"a is not zero"
nixfmt
outputs:
let
a = 0;
# checking if a == 0
in if a == 0 then "a is zero" else "a is not zero"
nixfmt
moves the comment before the in
which sort of makes sense for smaller comments but big blocks of comments look weird.
Is this intended behavior?
Moving the comment before the in
is intentional and currently the only case where comments are moved. The fact that it gets indented is not intentional and is something that will eventually be fixed once I get around to https://github.com/serokell/nixfmt/issues/32.
The layout in #118 does occasionally move comments around, but not in this case.