You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support an --assume-filename-like option to let rustfmt resolve rustfmt.toml if the input is passed from stdin.
clang-format has a --assume-filename option which let it knows where to find the format config file when the payload is passed from stdin:
--assume-filename=<string> - Set filename used to determine the language and to find
.clang-format file.
Only used when reading from stdin.
This would allow meta-formatters to pass file content that doesn't exist in the file system (for our use case: git history), while still letting rustfmt to figure out which format config to use.
Caveat: if the rustfmt.toml config file changes in history, this doesn't work, but I think it happens rarely enough.
The text was updated successfully, but these errors were encountered:
Thanks for reaching out and sharing! This is something that's actually been requested previously, discussed, and partially implemented, so I'm going to close this one to minimize bifurcation of discussion.
However, I really like the specifics of the proposal, so I will also cross-link the details you've brought forward in those other threads
Support an
--assume-filename
-like option to let rustfmt resolve rustfmt.toml if the input is passed from stdin.clang-format has a
--assume-filename
option which let it knows where to find the format config file when the payload is passed from stdin:This would allow meta-formatters to pass file content that doesn't exist in the file system (for our use case: git history), while still letting
rustfmt
to figure out which format config to use.Caveat: if the
rustfmt.toml
config file changes in history, this doesn't work, but I think it happens rarely enough.The text was updated successfully, but these errors were encountered: