treefmt will be adding a Stdin Spec. See https://github.com/numtide/treefmt/pull/586 for details. We should implement it, which means deprecating and removing the current behavior: 1. Read from stdin if no positional arguments are passed. 2. Use the filename specified via `--filename`: https://github.com/NixOS/nixfmt/pull/264 The new behavior will (*likely*, wait for treefmt's spec to be approved) be to: 1. Only read from stdin if the `--stdin-filepath <path>` option is passed (`<path>` *must* be specified). A benefit of deprecating the implicit read from stdin behavior is users won't get confused by `nixfmt` "freezing", as reported in https://github.com/NixOS/nixfmt/issues/301.
treefmt will be adding a Stdin Spec. See numtide/treefmt#586 for details.
We should implement it, which means deprecating and removing the current behavior:
--filename: Add--filenameflag for overriding the filename when using stdioTarget #264The new behavior will (likely, wait for treefmt's spec to be approved) be to:
--stdin-filepath <path>option is passed (<path>must be specified).A benefit of deprecating the implicit read from stdin behavior is users won't get confused by
nixfmt"freezing", as reported in #301.