Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cargo-rbmt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ clap = { version = "4", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.8"
public-api = "0.47"
26 changes: 20 additions & 6 deletions cargo-rbmt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ To ensure your package works with the full range of declared dependency versions

The `lock` command generates and maintains these files for you. You can then use `--lock-file` with any command to test against either version set.

### Usage

**Generate/update lock files**

```bash
cargo rbmt lock
```
Expand All @@ -127,8 +123,6 @@ cargo rbmt lock
2. Generate `Cargo-minimal.lock` with minimal versions across the entire dependency tree.
3. Update `Cargo-recent.lock` with conservatively updated dependencies.

**Use a specific lock file**

```bash
# Test with minimal versions.
cargo rbmt --lock-file minimal test stable
Expand All @@ -143,6 +137,26 @@ cargo rbmt --lock-file minimal docs

When you specify `--lock-file`, the tool copies that lock file to `Cargo.lock` before running the command. This allows you to test your code against different dependency version constraints.

## API Checking

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.

```bash
cargo rbmt api
```

1. Generates API snapshots for each feature configuration (no-features, alloc-only, all-features).
2. Validates that features are additive (enabling features only adds to the API, never removes).
3. Checks for uncommitted changes to API files.

The generated API files are stored in `api/<package-name>/`.

```bash
cargo rbmt api --baseline v0.1.0
```

Compares the current API against a baseline git reference (tag, branch, or commit) to detect breaking changes.

## Workspace Integration

`cargo-rbmt` can simply be installed globally on a system or added as a dev-dependency to a package.
Expand Down
Loading