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
Lint your crate API changes for semver violations.
@@ -16,6 +20,7 @@ $ cargo semver-checks
16
20
```
17
21
18
22
Or use as a [GitHub Action](https://github.com/obi1kenobi/cargo-semver-checks-action) (used in .github/workflows/ci.yml in this repo):
23
+
19
24
```yaml
20
25
- name: Check semver
21
26
uses: obi1kenobi/cargo-semver-checks-action@v2
@@ -95,6 +100,7 @@ No, it does not have to be published anywhere. You'll just need to use a flag to
95
100
By default, `cargo-semver-checks` uses crates.io to look up the previous version of the crate,
96
101
which is used as the baseline for semver-checking the current version of the crate.
97
102
The following flags can be used to explicitly specify a baseline instead:
103
+
98
104
```
99
105
--baseline-version <X.Y.Z>
100
106
Version from registry to lookup for a baseline
@@ -118,26 +124,28 @@ registries other than crates.io should use one of the other approaches of genera
118
124
By default, checking is done on all features except features named `unstable`, `nightly`, `bench`, `no_std`, or ones with prefix `_`, `unstable-`, or `unstable_`, as such names are commonly used for private or unstable features.
119
125
120
126
This behaviour can be overriden. Checked feature set can be changed to:
121
-
- *all* the features, selected with `--all-features`,
127
+
128
+
- _all_ the features, selected with `--all-features`,
122
129
- only the crate's default features, selected with `--default-features`,
123
130
- empty set, selected with `--only-explicit-features`.
124
131
125
132
Additionally, features can be enabled one-by-one, using flags `--features`, `--baseline-features` and `--current-features`.
126
133
127
134
For example, consider crate [serde](https://github.com/serde-rs/serde), with the following features (per v1.0.163):
135
+
128
136
- `std`- the crate's only default feature,
129
137
- `alloc`, `derive`, `rc` - optional features,
130
138
- `unstable`- a feature that possibly breaks semver.
131
139
132
-
| used flags | selected feature set | explanation |
133
-
|--|--|--|
134
-
| none | `std`, `alloc`, `derive`, `rc` | Feature `unstable` is excluded by the default heuristic. |
135
-
| `--features unstable` | `std`, `alloc`, `derive`, `rc`, `unstable` | The flag explicitly adds `unstable` to the heuristic's selections. |
136
-
| `--all-features` | `std`, `alloc`, `derive`, `rc`, `unstable` | All the features are used, disabling the default heuristic. |
137
-
| `--default-features` | `std` | The crate has only one default feature. |
138
-
| `--default-features --features derive` | `std`, `derive` | Feature `derive` is used along with crate's default features.
139
-
| `--only-explicit-features` | none | No explicit features are passed. |
140
-
| `--only-explicit-features --features unstable` | `unstable` | All features can be added explicitly, regardless of their name. |
140
+
| used flags | selected feature set | explanation |
0 commit comments