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

Don't display "hidden" features in cargo add #10794

Open
epage opened this issue Jun 27, 2022 · 4 comments
Open

Don't display "hidden" features in cargo add #10794

epage opened this issue Jun 27, 2022 · 4 comments
Labels
C-bug Category: bug Command-add S-triage Status: This issue is waiting on initial triage.

Comments

@epage
Copy link
Contributor

epage commented Jun 27, 2022

docs.rs treats _ prefixed features as hidden. cargo add should reflect that in reporting features to the user.

The question is if we should unconditionally hide the features, hide them if disabled, or do the tracking to hide it unless its directly enabled.

@epage epage added C-bug Category: bug Command-add labels Jun 27, 2022
@epage
Copy link
Contributor Author

epage commented Jun 27, 2022

@epage
Copy link
Contributor Author

epage commented Jul 14, 2022

I think the ideal is to hide them if they are not directly enabled.

It should be possible to implement this at end of the preparation when we print the features. See

if !activated.is_empty() || !deactivated.is_empty() {

@epage
Copy link
Contributor Author

epage commented Jul 19, 2022

We've talked about this at the cargo team meeting. We are reluctant to move forward with this for now; we'd like more time before committing to this.

We'd like the decision to be more intentional than "copy what docs.rs did without the background for their decision", including

  • We should consider how this impacts any possibility for officially tracking feature visibility or other feature state (unstable, deprecated, etc)
  • In a way, the more we codify this, the more we implicitly endorse snake_case as the feature naming style in contrast to kebab-case since _kebab-case would be out of place

@ehuss
Copy link
Contributor

ehuss commented Jul 19, 2022

I opened #10882 for a more general discussion of hidden features since I couldn't find an existing issue. This gist contains a list of packages that use features with a leading underscore, which might be interesting to review in more depth to see why and how people are using them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Command-add S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants