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
Copy file name to clipboardExpand all lines: cargo-rbmt/README.md
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,10 @@ Maintainer tools for Rust-based projects in the Bitcoin domain. Built with [xshe
9
9
-[Lint](#lint)
10
10
-[Test](#test)
11
11
-[Integration](#integration)
12
+
-[Fuzz](#fuzz)
12
13
-[Prerelease](#prerelease)
13
14
-[Lock Files](#lock-files)
15
+
-[API Checking](#api-checking)
14
16
-[Workspace Integration](#workspace-integration)
15
17
-[1. Install on system](#1-install-on-system)
16
18
-[2. Add as a dev-dependency](#2-add-as-a-dev-dependency)
@@ -91,6 +93,10 @@ package = "bitcoind-tests"
91
93
versions = ["29_0", "28_2", "27_2"]
92
94
```
93
95
96
+
## Fuzz
97
+
98
+
The `fuzz` command assumes there is a package in a workspace which defines fuzz targets.
99
+
94
100
## Prerelease
95
101
96
102
The `prerelease` command performs readiness checks before releasing a package. By default, all packages are checked unless they explicitly opt-out.
@@ -135,7 +141,7 @@ When you specify `--lock-file`, the tool copies that lock file to `Cargo.lock` b
135
141
136
142
## API Checking
137
143
138
-
The `api` command helps maintain API stability by generating public API snapshots and checking for breaking changes. It uses the [public-api](https://github.com/Enselic/cargo-public-api) crate to analyze a crate's public interface.
144
+
The `api` command helps maintain API stability by generating public API snapshots and checking for breaking changes. The generated API files are stored in `api/<package-name>/`.
139
145
140
146
```bash
141
147
cargo rbmt api
@@ -145,14 +151,30 @@ cargo rbmt api
145
151
2. Validates that features are additive (enabling features only adds to the API, never removes).
146
152
3. Checks for uncommitted changes to API files.
147
153
148
-
The generated API files are stored in `api/<package-name>/`.
149
-
150
154
```bash
151
155
cargo rbmt api --baseline v0.1.0
152
156
```
153
157
154
158
Compares the current API against a baseline git reference (tag, branch, or commit) to detect breaking changes.
155
159
160
+
### Whitelisting Breaking Changes
161
+
162
+
The `api` command checks for two types of breaking changes.
163
+
164
+
***Additivity** compares a package's `no-features` API vs. its `all-features` API to ensure its features are additive.
165
+
***Semver** compares some baseline version of a package's API vs the current API to ensure no breaking changes.
166
+
167
+
Sometimes breaking changes are intentional and safe (e.g., replacing a specific impl with a more general blanket impl for sealed traits). Configure the `[api]` section a your package's `rbmt.toml` to whitelist specific changes:
168
+
169
+
```toml
170
+
[api]
171
+
# Items that can be removed or changed without triggering errors.
172
+
allow_breaking_changes = [
173
+
"impl MyTrait for SpecificType",
174
+
"pub fn deprecated_function()",
175
+
]
176
+
```
177
+
156
178
## Workspace Integration
157
179
158
180
`cargo-rbmt` can simply be installed globally on a system or added as a dev-dependency to a package.
0 commit comments