Option to only run if rustfmt.toml exists
Ogeon opened this issue · 6 comments
It would be nice to have an option to only run rustfmt
if there's a rustfmt.toml
file in the crate root. This would make it easier to selectively enable automatic formatting for individual projects.
Hi, Please upgrade to version 0.3.0 and try our new feature(args support for rustfmt).
Does rustfmt
really have such an option? I can't find it.
@Ogeon Try to upgrade your rustfmt with following commands:
cargo uninstall rustfmt
cargo install rustfmt
Then you will find its usage by rustfmt --help
Sure, but which flag? Do you mean --config-path
? It will just use the default settings if it can't find a config file. What I'm talking about is making it not run at all if there is no config file. I tested with rustfmt --config-path ./ src/lib.rs
in the root of one of my projects.
Sorry Ogeon, I misunderstood your intentions.
I'll think about it (maybe add a new config in package setting), to disable rustfmt unless rustfmt.toml exists in the next coming version.
Thank you for your advice.
No worries. 😄 I think a config parameter would be great.