-
Notifications
You must be signed in to change notification settings - Fork 902
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
Support --workspace flag in cargo-fmt
#5010
Comments
There a reason that I know in some of my tools, I've found had problems with
Part of my curiosity is for better understanding the needs people have for |
Thanks for reaching out, but I'm going to close this as it has been discussed a few times and is not a matter of a simple rename (see #3911, #4441 and other workspace related issues). I appreciate the perspective and the desire for consistency, but this is a case where we'd introduce breaking behavioral changes if we were to rename flags to match what
Because it's way too powerful and heavy for what we need. |
Supporting I saw mention in #3911 that the behavior is different. Unfortunately, |
As stated previously, I get the desire for consistency and alignment with cargo and other subcommands, and if I had the luxury of starting with a completely clean slate that would definitely be the north star. However, we have to work within the constraints and realities of the present, for better or worse. While the changes, and/or additions, you are proposing to something in the rustfmt ecosystem would indeed increase alignment with something outside that ecosystem (cargo), they'd simultaneously muddy the waters/create confusion and contradiction within that ecosystem. That's not good either, and in my opinion has the potential to be marginally worse than where we are today.
No, we definitely wouldn't want to do that. You're still equating
Quoting myself a bit again but regardless of what is/isn't documented we're going to be dealing with folks that make the same understandable, but incorrect, assumption. Though not yet released, we have already made some adjustments to the help text; I'm just skeptical it'll move the needle much.
Feel like this has now been answered with the preceding text/links to past discussion on the topic (particularly #4247 (comment) and #3911)
As I'm sure you already know, stability and consistency are very real factors in the Rust ecosystem 😄 The combination of Rust's general posture on stability and the stability guarantee of rustfmt provide very little wiggle room to make breaking changes of any kind, which is why to this very day rustfmt's default emits some formatting that's very silly here in 2021 but has to continue to do so because once upon a time it was required (e.g. an extra space in nested tuple accesses) This absolutely applies to command line behavior an options as well. I understand that folks don't like the papercut of remembering to use |
This is basically what I was intending with my comment but I'm not seeing a reason here or in the link for why this is being rejected.
To be clear, I was trying to confirm my understanding since parts remained unclear. With your reply, I've picked up an additional piece (implicit workspaces), since I hadn't found that comment yet.
To be clear, before the "implicit workspace" explanation, this was sounding more like undefined behavior being treated as requiring compatibility which can be a murkier for what can be changed, depending on several factors. Understanding there is an intentional use case is different. Supporting a cargo aligned |
No one's saying the current state is perfect. What I've said is that there's no obvious improvements nor perfect state. It's a classic case of competing tradeoffs that's been exacerbated by changes to factors outside our control. Any change in this area that improves one side is going to cause degradation elsewhere. That doesn't mean we'll never make any changes, but it's a significantly more involved and complicated topic that we're not going to track/resolve as a simple issue like this one and those that preceded it.
I never said my proposal was rejected, in fact I said it was likely the only viable option, so I'm not really sure what this is in reference to (if it was regarding the state of the issue then I think my response above should address that)
Understood, was just noting that I felt in responding to/answering other questions in the same comment that this question happened to have gotten covered as well.
To be honest, I see rapidly diminishing returns in continuing to spend cycles going back and forth this. I feel like everything worth saying has already been said a few times in a few different ways, and I've got too big a backlog to continue debating something I think we actually largely agree on 😄 It's a topic that's been covered at length, and as I've already noted there's downsides/tradeoffs to the current behavior. Most folks seem to forget or overlook that it's pretty common for users to structure their projects with multiple crates that have non-strictly hierarchical path based dependencies, and do so without explicitly defining a workspace. It is (or at least was) common for the "implicit" phraseology to be used with various tools including and beyond rustfmt, and there is some etymology that ties back to cargo itself. However, I don't think it really matters what exactly it's called, nor is it worthwhile to get sidetracked by one label or another.
|
I think one take away from this is that this is a recurring question and that the information about it is spread far part. In being introduced to it, it took several back and forths, reading of the code, and links out to threads and specific comments in threads. It might be worth finding a clearer way to communicate this so to keep things more positive on boths sides of the conversation and reducing load on boths sides. |
Yeah I hear ya, good documentation can be of great utility. I'm all for getting something like that together, but it still boils down to a matter of priorities and is unlikely to happen in the near future (unless someone else is feeling particularly motivated). This has only come up maybe four or five times in the past two years, so unfortunately it probably doesn't even crack the list of the top ten recurring things that would benefit from some docs or a dedicated post. |
In Rust 1.39, the
--all
flag was renamed to--workspace
butcargo-fmt
still does not provide--workspace
.This is a frequent papercut for me as I write CI pipelines where I try to use the new flag everywhere but forget that
cargo-fmt
doesn't support it.The text was updated successfully, but these errors were encountered: