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
To ensure your crate works with the full range of declared dependency versions, `rbmt` requires two lock files in your repository.
66
+
To ensure your crate works with the full range of declared dependency versions, `cargo-rbmt` requires two lock files in your repository.
67
67
68
68
*`Cargo-minimal.lock` - Minimum versions that satisfy your dependency constraints.
69
69
*`Cargo-recent.lock` - Recent/updated versions of dependencies.
70
70
71
-
The `rbmt lock` command generates and maintains these files for you. You can then use `--lock-file` with any command to test against either version set.
71
+
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.
72
72
73
73
### Usage
74
74
75
75
**Generate/update lock files**
76
76
77
77
```bash
78
-
rbmt lock
78
+
cargo rbmt lock
79
79
```
80
80
81
81
1. Verify that direct dependency versions aren't being bumped by transitive dependencies.
@@ -86,49 +86,49 @@ rbmt lock
86
86
87
87
```bash
88
88
# Test with minimal versions.
89
-
rbmt --lock-file minimal test stable
89
+
cargo rbmt --lock-file minimal test stable
90
90
91
91
# Test with recent versions.
92
-
rbmt --lock-file recent test stable
92
+
cargo rbmt --lock-file recent test stable
93
93
94
94
# Works with any command.
95
-
rbmt --lock-file minimal lint
96
-
rbmt --lock-file minimal docs
95
+
cargo rbmt --lock-file minimal lint
96
+
cargo rbmt --lock-file minimal docs
97
97
```
98
98
99
99
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.
100
100
101
101
## Workspace Integration
102
102
103
-
`rbmt` can simply be installed globally, or as a dev-dependency for more granular control of dependency versions.
103
+
`cargo-rbmt` can simply be installed globally, or as a dev-dependency for more granular control of dependency versions.
104
104
105
105
### 1. Install globally
106
106
107
107
Install the tool globally on your system with `cargo install`.
108
108
109
109
```bash
110
-
cargo install rust-bitcoin-maintainer-tools@0.1.0
110
+
cargo install cargo-rbmt@0.1.0
111
111
```
112
112
113
-
Then run from anywhere in your repository.
113
+
Then run from anywhere in your repository as a cargo subcommand. It can also be called directly as `cargo-rbmt`.
114
114
115
115
```bash
116
-
rbmt lint
116
+
cargo rbmt lint
117
117
```
118
118
119
119
### 2. Add as a dev-dependency
120
120
121
-
Add as a dev-dependency to a workspace member. This pins the tool version in your lockfile for reproducible builds.
121
+
Add as a dev-dependency to a workspace member. This pins the tool version in your lockfile for reproducible builds. But this also means that `cargo-rbmt` dependencies could influence version resolution for the workspace.
122
122
123
123
```toml
124
124
[dev-dependencies]
125
-
rust-bitcoin-maintainer-tools = "0.1.0"
125
+
cargo-rbmt = "0.1.0"
126
126
```
127
127
128
128
Then run via cargo.
129
129
130
130
```bash
131
-
cargo run --bin rbmt -- lint
131
+
cargo run --bin cargo-rbmt -- lint
132
132
```
133
133
134
134
It might be worth wrapping in an [xtask](https://github.com/matklad/cargo-xtask) package for a clean interface.
0 commit comments