|
77 | 77 | # Run checks |
78 | 78 | cargo deny check |
79 | 79 | ``` |
| 80 | + |
| 81 | + **8. Test with Minimal Versions:** |
| 82 | + ```bash |
| 83 | + # Set dependencies to their minimum allowed versions (requires nightly) |
| 84 | + cargo +nightly update -Zminimal-versions |
| 85 | + |
| 86 | + # Run tests with stable compiler under minimal versions |
| 87 | + cargo +stable test --tests --benches |
| 88 | + |
| 89 | + # Restore normal (latest) versions afterwards |
| 90 | + cargo update |
| 91 | + ``` |
| 92 | + This catches cases where minimum version bounds in Cargo.toml are set too low. |
80 | 93 | ### Release Build |
81 | 94 | ```bash |
82 | 95 | cargo build --release |
|
163 | 176 | 2. **pre-commit.yaml** (Runs on PRs and merge groups): |
164 | 177 | - Runs pre-commit hooks (trailing whitespace, TOML/YAML validation, codespell, conventional commits) |
165 | 178 |
|
166 | | - 3. **codspeed.yml** (Runs on main branch pushes and PRs): |
167 | | - - Runs performance benchmarks |
168 | 179 |
|
169 | 180 | ## MSRV (Minimum Supported Rust Version) |
170 | 181 |
|
|
187 | 198 | 2. **ALWAYS run formatting:** `cargo +stable fmt --all -- --check` (auto-fix with `cargo +stable fmt --all`) |
188 | 199 | 3. **ALWAYS run clippy with nightly:** `cargo +nightly clippy --all-targets -- -D warnings` |
189 | 200 | 4. **Check MSRV consistency:** `sh tests/check-msrv-consistency.sh` if you modify Cargo.toml or src/lib.rs |
190 | | - 5. **Remove trailing spaces:** All files must have trailing whitespace removed (pre-commit checks enforce this) |
191 | | - 6. **Unix line terminators:** Unix regular \n terminators must be used |
192 | | - 7. **DO NOT modify CHANGELOG.md:** The changelog is updated automatically during the release process and should not be modified in pull requests |
193 | | - 8. When you add new tests while fixing a bug, ensure that those tests fail with the current code version and pass with your proposed changes. |
| 201 | + 5. **ALWAYS test with minimal versions** when modifying `Cargo.toml` dependencies: `cargo +nightly update -Zminimal-versions && cargo +stable test --tests --benches` (restore with `cargo update`) |
| 202 | + 6. **Remove trailing spaces:** All files must have trailing whitespace removed (pre-commit checks enforce this) |
| 203 | + 7. **Unix line terminators:** Unix regular \n terminators must be used |
| 204 | + 8. **DO NOT modify CHANGELOG.md:** The changelog is updated automatically during the release process and should not be modified in pull requests |
| 205 | + 9. When you add new tests while fixing a bug, ensure that those tests fail with the current code version and pass with your proposed changes. |
194 | 206 |
|
195 | 207 | ### Commit Message Format |
196 | 208 | This repository uses **conventional commits**. Every commit message must follow this format: |
|
211 | 223 | 4. **Tests must pass in both debug and release modes** on multiple toolchains (stable, beta, nightly, MSRV). |
212 | 224 | 5. **Documentation tests are separate** from regular tests. Always run both `cargo test --tests` and `cargo test --doc`. |
213 | 225 | 6. **Benchmarks are tests too**. Use `--benches` flag when running tests to include benchmark tests. |
214 | | - 7. **DO NOT modify CHANGELOG.md** in pull requests. The changelog is updated automatically by the release script (`release.sh`) which generates it from git commit messages. |
| 226 | + 7. **Minimal versions must compile**. When changing dependencies in Cargo.toml, always verify with `cargo +nightly update -Zminimal-versions && cargo +stable test --tests --benches`. Some transitive dependencies require a minimum floor entry in `[dev-dependencies]` (e.g. `regex`) to prevent `-Zminimal-versions` from selecting versions too old to compile with current Rust. |
| 227 | + 8. **DO NOT modify CHANGELOG.md** in pull requests. The changelog is updated automatically by the release script (`release.sh`) which generates it from git commit messages. |
215 | 228 |
|
216 | 229 | ## Development Workflow |
217 | 230 |
|
|
0 commit comments