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
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 #3822.
- This allows people to defer responding to each new batch of
deprecations and instead do it at once. This means we should
reconsider #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
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -38,10 +38,12 @@ Our releases fall into one of:
38
38
- Aspire to at least 6-9 months between releases
39
39
- Remove all deprecated functionality
40
40
- Try to minimize new breaking changes to ease user transition and reduce time "we go dark" (unreleased feature-branch)
41
+
- Upon release, a minor release will be made for the previous major that enables `deprecated` feature by default
41
42
- Minor releases which are for minor compatibility changes
42
43
- Aspire to at least 2 months between releases
43
44
- Changes to MSRV
44
-
- Deprecating existing functionality
45
+
- Deprecating existing functionality (behind the `deprecated` feature flag)
46
+
- Making the `deprecated` feature flag enabled-by-default (only on last planned minor release)
45
47
-`#[doc(hidden)]` all deprecated items in the prior minor release
46
48
- Patch releases
47
49
- One for every user-facing, user-contributed PR (i.e. release early, release often)
@@ -51,7 +53,7 @@ If your change does not fit within a "patch" release, please coordinate with the
51
53
Some practices to avoid breaking changes
52
54
- Duplicate functionality, with old functionality marked as "deprecated"
53
55
- Common documentation pattern: `/// Deprecated in [Issue #XXX](https://github.com/clap-rs/clap/issues/XXX), replaced with [intra-doc-link]`
54
-
- Common deprecation pattern: `#[deprecated(since = "X.Y.Z", note = "Replaced with `ITEM` in Issue #XXX")]`
56
+
- Common deprecation pattern: `#[cfg_attr(feature = "deprecated", deprecated(since = "X.Y.Z", note = "Replaced with `ITEM` in Issue #XXX"))]`
55
57
- Please keep API addition and deprecation in separate commits in a PR to make it easier to review
56
58
- Develop the feature behind an `unstable-<name>` feature flag with a stablization tracking issue (e.g. [Multicall Tracking issue](https://github.com/clap-rs/clap/issues/2861))
Copy file name to clipboardexpand all lines: README.md
+1
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,7 @@ Why use the procedural [Builder API](https://github.com/clap-rs/clap/blob/v3.2.2
140
140
141
141
#### Optional features
142
142
143
+
***deprecated**: Guided experience to prepare for next breaking release (at different stages of development, this may become default)
143
144
***derive**: Enables the custom derive (i.e. `#[derive(Parser)]`). Without this you must use one of the other methods of creating a `clap` CLI listed above.
144
145
***cargo**: Turns on macros that read values from `CARGO_*` environment variables.
145
146
***env**: Turns on the usage of environment variables during parsing.
0 commit comments