-
Notifications
You must be signed in to change notification settings - Fork 926
[Feature Request] Read cargo fmt
configurations from .cargo/config.toml
#5988
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
Thanks for reaching out!
@calebcartwright correct me if I'm wrong, but I don't think there's been any discussion about reading configurations / env variables from the @aDogCalledSpot to the best of my knowledge, and the Contributing guide the As you've demonstrated above, you can certainly use the |
cargo fmt
configurations from .cargo/config.toml
Interesting, I wasnt aware of the intended use case. Sorry. Since this is a feature request now, Ill give some more context of what I'm trying to achieve. I have a project using Yew with some other collaborators. I recently found yew-fmt which fomats the code in Yew's It makes sense to use this for the project but I dont want to set |
Looks like this is where the Thanks for sharing your usecase. In order to support it we'd need to read configurations from the |
I created a shell script called echo "Hey There you're using my custom formatter!!!"
echo "passing the following to rustfmt!"
for var in "$@"
do
echo "$var"
done Running the
prints
Running
However running the
prints out From what I can tell this doesn't seem to be an issue with the |
I just tried this in my test project where have the env var set in the config.toml, and to my surprise I get:
|
The values from |
Yeah. I was just looking at these docs: https://doc.rust-lang.org/cargo/reference/config.html#env, but like I said before cargo reads the It seems that everything is working as expected, and you'll need to make sure that |
I would like a single project to use a custom formatter. I have created a
.cargo/config.toml
with the following contents:however, the usual formatter appears to be called.
Using
RUSTFMT="echo" cargo fmt
returns/path/to/main.rs --edition 2021
as expected.The text was updated successfully, but these errors were encountered: