-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
set nixfmt as the default formatter for nix #11001
set nixfmt as the default formatter for nix #11001
Conversation
Is it stable yet ? I agree that using what is going to be the official formatter is nice but it's still in < 1.0 so I'm afraid they'll do breaking changes yet and we'll get issues with people complaining helix is changing all the formatting because of two different versions of nixfmt on two machines |
could they... use nix to avoid that? joking aside, if this a concern a practical solution would just be disable |
I must admit I laughed 😁 And really my comment was a question for you. I settled on "nixpkgs-fmt" a long time ago for nix formatting because I didn't want to depend on something that, at the time, was still only a project and not actual working code, but if the situation has changed and stabilized, adding out of the box support in helix is certainly something I'll agree with. I have not followed evolutions though, so I genuinely don't know 😅 |
the current RFC style is packaged in the main points here:
|
Yeah let's keep auto-format off for now by default. We should only enable auto-format for languages where formatting is ubiquitous like Rust - otherwise it can unexpectedly reformat older code. Eventually if formatting becomes very popular for Nix we can enable it but where the RFC was accepted recently I think it's too soon. Super ideally though we wouldn't need to set up a |
works for me, thanks |
sets the default formatter for nix to
nixfmt
and enables auto-formatting.closes #10803