-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
quiet by default? #295
Comments
|
@robx You can always use |
In short, something like: {
formatter.${system} = nixpkgs.writeShellScriptBin "alejandra" ''
exec ${nixpkgs.alejandra}/bin/alejandra --quiet "$@"
'';
} We would need a survey in order to know what mode (tui vs cli vs quiet) is preferred and make it the default I personally chose to use tui as default because the progress bar helps a lot when formatting large codebases, but I understand why the quiet philosophy is valuable to some people, too |
I use Like @robx, this is my only issue with the application, so I think having a survey on the default behaviour would be nice. Personally, I prefer the quiet mode:
|
I just created some poll over here: https://discourse.nixos.org/t/the-uncompromising-nix-code-formatter/17385/48?u=kamadorueda And it seems this is actually a good idea, not to mention other people also support this point of view: https://en.wikipedia.org/wiki/Unix_philosophy |
Some updates to the CLI just landed master, it would be good if you help me review them before creating a release, with them, this issue could be closed |
I see this now, without a
|
👍🏾 I think the new default is an improvement. I would have preferred it to be like this though:
If you agree, I'd be willing to do a PR for this. |
I've been using this to format neovim buffers with |
I don't see why it would be only sometimes, but this looks to be the culprit, it's right outside of the quiet check: alejandra/src/alejandra_cli/src/cli.rs Lines 198 to 201 in ac74bc5
|
Thanks! let me fix it |
Also, @kamadorueda: is there a reason that the ads here are printed to stdout, when otherwise the status messages are printed to stderr? Seems like it could also break things. alejandra/src/alejandra_cli/src/cli.rs Lines 206 to 211 in ac74bc5
|
No, I must have been distracted when I implemented that, fix is here: #340 |
@SignalWalker I just fixed that:
Do you think printing the error when formatting stdin is useful? I just tried it in Vim and the error message is injected into the buffer, which then requires an 'undo' to revert the change Would one of the following be helpful for Vim users?
|
|
I just released 3.0.0 While this issue was not exactly implemented as initially proposed, the new CLI output contains the elements the community cares about the most and the identified pain points were fixed |
FWIW configuring according to https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-fmt.html (included below) makes it not quiet.
|
I just tried out the new
nix fmt
with alejandra after upgrading to nixos 22.05, by settingIt's almost great, except the excessive colored console output makes me have second thoughts. What do you think of setting it up such that it runs with
-q
by default? Essentially, I'd likenix fmt
to have no output at all if my files are in order.The text was updated successfully, but these errors were encountered: