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
--config-path [Path for the configuration file]
Recursively searches the given path for the
rustfmt.toml config file. If not found reverts to the
input file path
However it doesn't seem to recurse:
$ rustfmt --config-path ~/Downloads/test_issue/my_crate/src/main.rs --edition 2018 < ~/Downloads/test_issue/my_crate/src/main.rs
Could not parse TOML: expected an equals, found an identifier at line 1 column 4
$ rustfmt --config-path ~/Downloads/test_issue/my_crate/src/ --edition 2018 < ~/Downloads/test_issue/my_crate/src/main.rs
Error: unable to find a config file for the given path: `~/Downloads/test_issue/my_crate/src/`
$ rustfmt --config-path ~/Downloads/test_issue/my_crate/src --edition 2018 < ~/Downloads/test_issue/my_crate/src/main.rs
Error: unable to find a config file for the given path: `~/Downloads/test_issue/my_crate/src`
$ rustfmt --config-path ~/Downloads/test_issue/my_crate --edition 2018 < ~/Downloads/test_issue/my_crate/src/main.rs
fn fjsdlkfjklsdajflksdjlfdasdsadsadsaadkjdskljflkasj_jflksjdklfjsdlkjflkdjslkfjas(a: i32, b: i32, c: i32) {
println!("TEST");
}
fn main() {
fjsdlkfjklsdajflksdjlfdasdsadsadsaadkjdskljflkasj_jflksjdklfjsdlkjflkdjslkfjas(1, 2, 3);
println!("Hello, world!");
}
$ rustfmt --config-path ~/Downloads/test_issue/ --edition 2018 < ~/Downloads/test_issue/my_crate/src/main.rs
Error: unable to find a config file for the given path: `~/Downloads/test_issue/`
I want to say that this has already been fixed in source, but hasn't been backported to a 1.x release yet. Will dig back through the issue tracker to check though, and if so will see if I can't get that fix cherry-picked for the next v1.4.33 release
Describe the bug
The
--config-path
help description says:However it doesn't seem to recurse:
To Reproduce
Test project is the one from rust-lang/rust-analyzer#6973 (comment)
Expected behavior
rustfmt --config-path
follows the same logic asrustfmt
Meta
rustfmt 1.4.32-nightly (216a643 2021-01-16)
rustup
rustfmt
The text was updated successfully, but these errors were encountered: