Skip to content

Commit 760d66d

Browse files
committed
docs(Compatibility Policy): adds an official compatibility policy to
Closes #740
1 parent 65eb338 commit 760d66d

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

.github/CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ There are a few goals of `clap` that I'd like to maintain throughout contributio
3535
* Remain backwards compatible when possible
3636
- If backwards compatibility *must* be broken, use deprecation warnings if at all possible before removing legacy code
3737
- This does not apply for security concerns
38+
- `clap` officially supports the current stable version of Rust, minus two releases (i.e. if 1.13.0 is current, `clap` must support 1.11.0 and beyond)
3839
* Parse arguments quickly
3940
- Parsing of arguments shouldn't slow down usage of the main program
4041
- This is also true of generating help and usage information (although *slightly* less stringent, as the program is about to exit)

README.md

+28-4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Table of Contents
3333
* [How to Contribute](#how-to-contribute)
3434
* [Running the tests](#running-the-tests)
3535
* [Goals](#goals)
36+
* [Compatibility Policy](#compatibility-policy)
37+
* [Minimum Version of Rust](#minimum-version-of-rust)
3638
* [License](#license)
3739
* [Recent Breaking Changes](#recent-breaking-changes)
3840
* [Deprecations](#deprecations)
@@ -645,11 +647,11 @@ fn main() {
645647

646648
## Usage
647649

648-
For full usage, add `clap` as a dependency in your `Cargo.toml` file to use from crates.io:
650+
For full usage, add `clap` as a dependency in your `Cargo.toml` (it is **highly** recommended to use the `~major.minor.patch` style versions in your `Cargo.toml`, for more information see [Compatibility Policy](#compatibility-policy)) to use from crates.io:
649651

650652
```toml
651653
[dependencies]
652-
clap = "2"
654+
clap = "~2.19.0"
653655
```
654656

655657
Or get the latest changes from the master branch at github:
@@ -677,15 +679,15 @@ To disable these, add this to your `Cargo.toml`:
677679

678680
```toml
679681
[dependencies.clap]
680-
version = "2"
682+
version = "~2.19.0"
681683
default-features = false
682684
```
683685

684686
You can also selectively enable only the features you'd like to include, by adding:
685687

686688
```toml
687689
[dependencies.clap]
688-
version = "2"
690+
version = "~2.19.0"
689691
default-features = false
690692
691693
# Cherry-pick the features you'd like to use
@@ -754,6 +756,28 @@ There are a few goals of `clap` that I'd like to maintain throughout contributio
754756
- Once parsing is complete, the memory footprint of `clap` should be low since the main program is the star of the show
755757
* `panic!` on *developer* error, exit gracefully on *end-user* error
756758

759+
### Compatibility Policy
760+
761+
Because `clap` takes SemVer and compatibility seriously, this is the official policy regarding breaking changes and previous versions of Rust.
762+
763+
`clap` will pin the minimum required version of Rust to the CI builds. Bumping the minimum version of Rust is considered a minor breaking change, meaning *at a minimum* the minor version of `clap` will be bumped.
764+
765+
In order to keep from being suprised of breaking changes, it is **highly** recommended to use the `~major.minor.patch` style in your `Cargo.toml`:
766+
767+
```toml
768+
[dependencies]
769+
clap = "~2.19.0"
770+
```
771+
772+
This will cause *only* the patch version to be updated upon a `cargo update` call, and therefore cannot break due to new features, or bumped minimum versions of Rust.
773+
774+
#### Minimum Version of Rust
775+
776+
`clap` will officially support current stable Rust, minus two releases, but may work with prior releases as well. For example, current stable Rust at the time of this writing is 1.13.0, meaning `clap` is garunteed to compile with 1.11.0 and beyond.
777+
At the 1.14.0 release, `clap` will be garunteed to compile with 2.12.0 and beyond, etc.
778+
779+
Upon bumping the minimum version of Rust (assuming it's within the stable-2 range), it *must* be clearly annotated in the `CHANGELOG.md`
780+
757781
## License
758782

759783
`clap` is licensed under the MIT license. Please read the [LICENSE-MIT](LICENSE-MIT) file in this repository for more information.

0 commit comments

Comments
 (0)