check-versions

Crates.iocheck-versions
lib.rscheck-versions
version0.1.2
sourcesrc
created_at2017-09-10 13:46:26.511878
updated_at2017-09-18 14:06:08.093223
descriptionSimple crate for ensuring that version numbers in README files are updated when the crate version changes.
homepage
repositoryhttps://github.com/mgeisler/check-versions
max_upload_size
id31287
size22,865
Martin Geisler (mgeisler)

documentation

https://docs.rs/check-versions/

README

check-versions

This crate has been renamed to version-sync. Please update your dependencies.

The check-versions crate is a simple crate that will help you remember to update the versions numbers in your README.md file.

Usage

Add this to your Cargo.toml:

[dev-dependencies]
check-versions = "0.1"

Then create a tests/check-versions.rs with:

#[macro_use]
extern crate check_versions;

#[test]
fn test_readme_deps() {
    assert_markdown_deps_updated!("README.md");
}

This test will ensure that the dependencies mentioned in your README.md file is kept in sync with your crate version:

$ cargo test --test check-versions -- --nocapture
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running target/debug/deps/check_versions-3b40b9d452dd9385

running 1 test
Checking code blocks in README.md...
README.md (line 10) ... ok
test test_readme_deps ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Here the README.md file still references version 0.1.0, while the version number in Cargo.toml has been changed to 0.2.0. The test fails and the code block with the error is shown:

$ cargo test --test check-versions -- --nocapture
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running target/debug/deps/check_versions-8fbc5f3b97f4ec3a

running 1 test
Checking code blocks in README.md...
README.md (line 10) ... expected minor version 2, found 1 in
    [dev-dependencies]
    check-versions = "0.1"

thread 'test_readme_deps' panicked at 'dependency errors in README.md', tests/check-versions.rs:6:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
test test_readme_deps ... FAILED

failures:

failures:
    test_readme_deps

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--test check-versions'

Release History

This is a changelog describing the most important changes per release.

Version 0.1.2 — September 18th, 2017

Identical to version 0.1.1, but with better deprecation notices.

Version 0.1.1 — September 18th, 2017

The crate will be renamed to version-sync and this is the last release of the crate under the name check-versions.

Version 0.1.1 is identical in functionality to version 0.1.0, except that using the crate will trigger a deprecation warning with instructions to use version-sync instead.

Version 0.1.0 — September 10th, 2017

First public release with support for finding outdated version numbers in dependencies and dev-dependencies.

License

The check-versions crate can be distributed according to the MIT license. Contributions will be accepted under the same license.

Commit count: 301

cargo fmt