-
Notifications
You must be signed in to change notification settings - Fork 925
rustfmt --help
panics when stdout is closed
#5114
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
Comments
Is there a practical/realistic case where you're encountering this in an impactful way? I ask because it seems rather contrived, and is something you'll likely encounter with any program that's using |
I think the issue is that CLI tools should be using I don't think production grade tools (which is what rustfmt is) should expose panics to users, even if they do unreasonable things. |
I can't really envision piping scenarios with the help text so I wanted to know whether this was something you were running into in practice (because that would play a factor in prioritization), or whether it was more general/philosophical. println panics aren't new and can be found in a variety of tooling. It's quite alright (admirable even!) if you're on a mission to highlight these cases across the ecosystem. It's just not going to be a huge priority for us unless there's a real use case where it's problematic. Panics are of course not desirable. There's no need to inform the rustfmt team of the production status of rustfmt, nor that panics should be avoided |
Piping help text to grep is something fairly common. $ rustfmt --help | grep config
--config-path [Path for the configuration file]
rustfmt.toml config file. If not found reverts to the
--print-config [default|minimal|current] PATH
Dumps a default or minimal config to PATH. A minimal
config is the subset of the current config file used
to stdout current config as if formatting the file at
--config [key1=val1,key2=val2...]
`config` While this doesn't panic on my machine, it is conceivable that a shell pipeline could be set up with grep and rustfmt that does cause a panic.
Apologies for the tone of my previous comment. I added the parenthetical to avoid coming across as implying that rustfmt is not a production grade tool. Thank you and the team for rustfmt. |
No worries, thanks for clarifying! |
Going to close this as it's likely a duplicate of #2926 |
The text was updated successfully, but these errors were encountered: