-
-
Notifications
You must be signed in to change notification settings - Fork 66
Description
Description
Tools that automatically format files (e.g. Neovim, Jujutsu with jj fix, etc.) often work by calling a formatter like Nixfmt by passing a file's contents to stdin and then getting the formatted result via stdout, which has the benefit that the caller would have complete control over the original file, instead of having the formatter potentially overwriting it.
However, a drawback is that when there is a formatting error, all context around the filename is lost, which could be frustrating when dozens of files are involved:
$ jj fix
<stdin>:71:3:
|
71 | '';
| ^
unexpected '''
expecting expressionSome other formatters like clang-format allow the user to supply the actual filename via an CLI option (e.g. --assume-filename) while still accepting input via stdin, and I think it would be great if Nixfmt would have something similar.
Metadata
Metadata
Assignees
Labels
Projects
Status