-
-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoformatting PRs #1054
Comments
I've been meaning to get around to adding an autoformatter for this codebase, I would definitely merge a PR that adds it to the codebase using https://github.com/cachix/git-hooks.nix or something similar |
Yes, we should format with |
The stage at which the hook runs at can be customized with the I don't agree that we should punt on hooks even if we could only have a |
Part of the problem is that hooks/development shells are a security can of worms, because they come from the currently checked‐out commit but run outside of Nix builds. That means that they’re a very easy takeover vector for anyone who checks a PR out to review it, especially if they’re installed by default in an |
That sounds reasonable to me to not include |
IMO the easiest path forward is to leverage {
outputs = {
formatter = forAllSystems ({ pkgs }: pkgs.nixfmt-rfc-style);
};
} Mention in a |
Since |
About recursive mode, there seems to be some confusion:
Note that |
AFAIK |
It doesn't match my experience. edit: I should have mentionned that I'm still using |
While I was preparing #1053, I noticed that
nixfmt
makes significant changes to the current formatting (I am currently runningnixfmt nixpkgs-unstable-2024-08-16
). Isnix-darwin
interested in adopting the RFC version ofnixfmt
? Should contributors use it (or explicitly avoid it)? It would be nice to have some sort of agreed approach to autoformatting.The text was updated successfully, but these errors were encountered: