-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo new: create README in bin crates #8029
cargo new: create README in bin crates #8029
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Eh2406 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thank you for the PR! The decision described here is somewhat old, for example it predates my involvement with cargo. @rust-lang/cargo what do we now thing about the plan? |
I don't personally at least remember much about the context of the original decision. I don't really have many opinions about readmes either, and I'd be fine adding templates if others feel it's a good enough idea. |
I am personally not convinced that we should go with the proposed solution. I relate to the arguments provided by @sanmai-NL in this, this, this, and other comments from the original discussion, that note that we shouldn't enforce a particular readme format. When I was reading that thread before, I decided not to work on this issue myself since there wasn't any consensus reached, despite the seeming push of "Let's just do README.md" by prominent team members. |
The Cargo team discussed this feature and we've decided to close this PR for now. There is some disagreement about what the Readme should contain, or even if it should be created at all. I think the obvious solution is some kind of template system, where the user can specify their default templates to get whatever behavior they want. There are several efforts that implement templated projects, such as cargo-generate and cargo-readme. See also the tracking issue #5151 and https://internals.rust-lang.org/t/pre-rfc-cargo-templates/5056. Ideally a proposal to add templates to Another possibility to explore is to add an interactive mode to @jsjoeio if you'd be interested in exploring those routes, let us know! It might also help to know what your interest is in this feature, or what motivated this PR. |
I knew there would be some risk in attempting this without formal approval. Makes total sense. Though I'm glad it was revisited.
Good to know! Thank you for explaining that.
I might be! It would be great to learn about the RFC process, get more involved with Rust, and potentially work with other folks to get this implemented. Let me think on it over the weekend :)
New to Rust, wanted to contribute. When I first tried I noticed it didn't include a
Thank you to the Cargo team for discussing! @ehuss if after the weekend, I decide I want to help with this effort, what would you suggest as next steps? My thoughts:
|
@jsjoeio Glad to hear you have the motivation to do this right! |
Thank you @aleksator! I've thought about it and decided I do want to help with this effort. I'm going to start an RFC and go from there. I'll leave a comment on the original issue so others are aware. Thanks all for you help! |
Yea. The RFC repo should explain the process. Generally people start with a basic proposal and post it for the community to get initial feedback (often on internals).
It is a sub-team of the dev-tools. |
Awesome, thank you! Just posted a Pre-RFC on internals. Link for anyone interested in checking it out. |
This PR completes some of the work for #3506.
Changes
README
for new binary crates as part ofcargo new
cargo_new
to check/!check forREADME
Screenshots
Example of new change to
cargo new
:creates a
README.md
for a new binary cratePassing tests:
Failing test (safe to ignore):
Checklist
Additional Notes
Per the original decision noted in this comment, these were the requirements (this PR accomplishes the ones that are checked):
I was able to detect bin vs library crates, but I struggled to do the same for workspace crates. Open to guidance or feedback on how to detect that within the
new
command file.Regarding the remaining todos, my thoughts were to accomplish them in separate PRs.