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
When creating a new project with dx new, after the directory is created cargo fmt is ran. If this is in a workspace where the user has not pre-added the crate to workspace members list, the user is presented with a cargo fmt error message.
Everything else runs fine, and the command has an exit code of 0, as everything is fine, it just looks worrying.
Implement Suggestion
Not sure how possible it is, currently investigating, but if the user is in a workspace either
the user is asked in the template whether to add the newly created crate to members or not
or; add it anyway without asking
The text was updated successfully, but these errors were encountered:
I'm reading cargo-metadata, but nothing is jumping out at me to say "this is a workspace" vs "this is a standalone package.
Maybe checking the length of workspace_members, and if there's only 1 checking if it matches the workspace_root?
I'm thinking of use cases/edge cases though;
A user runs dx new - their current directory is outside any cargo workspace
This is as-is, and should predictably make the directory and run cargo fmt as well as the rest of the flow
A user runs dx new - their current directory is a multi-crate cargo workspace
This is the flow I just ran, and everything is made fine (I just had to add the new crate to package members), I'd like to avoid this manual work if possible.
A user runs dx new - their current directory is a single rust crate
This produces the directory, but possibly isn't what the user expected? (Not sure what I'd expect here)
Feature Request
When creating a new project with
dx new
, after the directory is createdcargo fmt
is ran. If this is in a workspace where the user has not pre-added the crate to workspace members list, the user is presented with a cargo fmt error message.Everything else runs fine, and the command has an exit code of 0, as everything is fine, it just looks worrying.
Implement Suggestion
Not sure how possible it is, currently investigating, but if the user is in a workspace either
The text was updated successfully, but these errors were encountered: