Skip to content
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

Option to set default authors for cargo new|init #15027

Open
Kladki opened this issue Jan 7, 2025 · 5 comments
Open

Option to set default authors for cargo new|init #15027

Kladki opened this issue Jan 7, 2025 · 5 comments
Labels
A-manifest Area: Cargo.toml issues C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-init Command-new S-triage Status: This issue is waiting on initial triage.

Comments

@Kladki
Copy link

Kladki commented Jan 7, 2025

Problem

When making a new cargo package, I rarely set the author to anything other than myself. I don't want to have to write out my full name and email whenever I make a new package.

Proposed Solution

Inside the cargo configuration file, there should be an option to set default authors which should be set when running cargo new or cargo init.

Notes

No response

@Kladki Kladki added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Jan 7, 2025
@epage epage added Command-new Command-init A-manifest Area: Cargo.toml issues labels Jan 7, 2025
@epage
Copy link
Contributor

epage commented Jan 7, 2025

We used to infer package.author (#2696) but we then removed setting author in #9282. RFC 3052 explicitly called out that we'd not set the field. This proposal is for making it an opt-in but the value of package.authors is fairly limited. In fact, I wonder if we should instead be deprecating it.

@weihanglo
Copy link
Member

What is the difference between the current status and deprecating it. Is it like an announcement that Cargo no longer develops any new feature for it?

@epage
Copy link
Contributor

epage commented Jan 7, 2025

Some combination of

  • Document it as deprecated (and reject features)
  • Provide a deprecation warning on use
  • Remove on next edition

@weihanglo
Copy link
Member

  • Document it as deprecated (and reject features)

This looks fine, if we focus on rejectin features.

  • Provide a deprecation warning on use
  • Remove on next edition

This would push people away from using package.authors. Popular crates like clap provide crate_authors! macro to populate the value at compile time. And there are thousands of uses of it on GitHub.
Do we prepare to have that churn for the ecosystem?

As an alternative, we could decide to freeze any feature regarding package.authors in this issue. Whenever a new feature request pops up, we link to this issue.

@epage
Copy link
Contributor

epage commented Jan 7, 2025

clap no longer includes the authors in any output by default. Looking at a sampling of those search results:

  • package.authors is set and authors is set on clap, but clap isn't showing it
  • package.authors is not set and authors is set on clap, but clap isn't showing it
  • they are using clap v2 which means it is likely legacy code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-manifest Area: Cargo.toml issues C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-init Command-new S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

3 participants