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

fix: Allow people to opt-in to deprecations #3830

Merged
merged 1 commit into from Jun 14, 2022
Merged

Conversation

epage
Copy link
Member

@epage epage commented Jun 14, 2022

This adds a new Cargo.toml feature named deprecated that opts
controls whether deprecation warnings show up. This is starting off as
non-default though that may change (see below).

Benefits

The one risk is people who don't follow blog posts and guides having a
harder time upgrading to the next breaking release without the warnings
on by default. For these users, we reserve the right to make the
deprecated feature default. This is most likely to happen in a
minor release that is released in conjunction with the next major
release (e.g. when releasing 4.0.0, we release a 3.3.0 that enables
deprecations by default). By using a feature, users can still disable
this if they want.

Thanks @joshtriplett for the idea

This adds a new `Cargo.toml` feature named `deprecated` that opts
controls whether deprecation warnings show up.  This is starting off as
non-default though that may change (see below).

Benefits
- Allows a staged rollout so a smaller subset of users see new
  deprecations and can report their experience with them before everyone
  sees them.  For example, this reduces the number of people who have to
  deal with clap-rs#3822.
- This allows people to defer responding to each new batch of
  deprecations and instead do it at once.  This means we should
  reconsider clap-rs#3616.

The one risk is people who don't follow blog posts and guides having a
harder time upgrading to the next breaking release without the warnings
on by default.  For these users, we reserve the right to make the
`deprecated` feature `default`.  This is most likely to happen in a
minor release that is released in conjunction with the next major
release (e.g. when releasing 4.0.0, we release a 3.3.0 that enables
deprecations by default).  By using a feature, users can still disable
this if they want.

Thanks @joshtriplett for the idea
@epage epage merged commit b619699 into clap-rs:master Jun 14, 2022
@epage epage deleted the deprecate branch June 14, 2022 16:07
epage referenced this pull request in stencila/stencila Jun 15, 2022
These should be able to be removed when upgrading to `clap` 4.0.
This was done rather than adding numerous `#[clap(value_parser)]` attributes.
See clap-rs/clap#3822.
epage referenced this pull request in Byron/gitoxide Jun 15, 2022
I'd rather not have to deal with the new API because there is no problem
with the old one for me.

Once 4.0 becomes the default, the work has to be put in to probably
achieve the same, but I hope it's not more wordy than before.
I also hope that inconveniences will be figured out by the folks in the
mean time.

Related to clap-rs/clap#3822
epage referenced this pull request in sebastinas/drt-tools Jun 15, 2022
clap >= 3.2 adds no value, so let them figure out what they want first.
This sounds like change for the sake of change.

See also clap-rs/clap#3822
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant