-
Notifications
You must be signed in to change notification settings - Fork 923
In workspaces, cargo fmt
only works in the top-level directory #8724
#4432
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
You need to include the |
It should say that in the error message, then. Right now it just looks like a bug. |
I just wanted to clarify that the expected behavior you provided in the issue description was not in alignment with the expected cargo fmt behavior. Full workspace formatting from a subdirectory is supposed to be an opt-in via the flag so that folks have the ability to format just the local member as well as the entire workspace. That being said, I do agree there's a bug and suspect it's a regression of an older one |
@calebcartwright it is unclear to me what is considered the bug in this scenario and what the expected behavior since it sounds like some of the behavior is expected. Personally, I would expect it to behave like (came across this issue when looking at #5010) |
This also happens if you're not inside of any package inside the workspace, e.g. a |
See also #2280. |
What are the updates on this? |
Describe the bug
To Reproduce
cargo new outer && cd outer
cargo new inner
printf '[workspace]\nmembers = ["inner"]' >> Cargo.toml
cd src
cargo fmt
Expected behavior
cargo fmt
should format all packages in the workspace, like it does from the top-level directory.Meta
rustfmt 1.4.18-stable (8157a3f 2020-07-15)
cargo fmt
The text was updated successfully, but these errors were encountered: