Open nrdxp opened 3 years ago
I'm good with anything that's applied consistently. I think I like the output of nixpkgs-fmt
better but I'm too lazy to double check atm.
I format everything with nixfmt
automatically, so please stick to that. And yes, I have a hook for that in git, but applying that for everyone is kinda hard.
This might actually be a good first step for the new ci.nix :)
devshell has a way of setting git hooks inside a nix-shell. Perhaps we could just steal that? I am currently using it in DevOS to run a formatter there as well.
https://github.com/input-output-hk/makes/blob/main/src/evaluator/modules/format-nix/entrypoint.sh must be amended & maintained if it will be nixfmt
.
I've been using nixfmt in accordance with @manveru's preference since I started, but I've come to notice that not everyone seems to be doing this. This leads to larger diffs in commits than is really necessary. I can add a pre-commit hook to run a formatter, but I'd first like to gain a bit of feedback about which to use.
The only real contenders at this point are nixfmt and nixpkgs-fmt. While I actually agree that
nixfmt
has nicer output atm, my vote would be fornixpkgs-fmt
simply because it seems to be what nixpkgs will eventually use, and so it's more likely to not be abandoned./cc @jonringer @kreisys @johnalotoski @sevanspowell @cleverca22