Crate version_sync
source ·Expand description
version-sync provides macros for keeping version numbers in sync
with your crate version.
When making a release of a Rust project, you typically need to adjust some version numbers in your code and documentation. This crate gives you macros that covers some typical cases where version numbers need updating:
-
TOML examples in the
README.mdfiles that show how to add a dependency on your crate. Seeassert_markdown_deps_updated. -
A
Changelog.mdfile that should at least mention the current version. Seeassert_contains_regex. -
The
html_root_urlattribute that tells other crates where to find your documentation. Seeassert_html_root_url_updated.
A typical configuration will use an integration test to verify
that all version numbers are in sync. Create a
tests/version-numbers.rs file with:
#[macro_use]
extern crate version_sync;
#[test]
fn test_readme_deps() {
assert_markdown_deps_updated!("README.md");
}
#[test]
fn test_html_root_url() {
assert_html_root_url_updated!("src/lib.rs");
}
When you run cargo test, your version numbers will be
automatically checked.
Macros
html_root_url attribute is up to date.Functions
path contain the regular expression given by
template.html_root_url attributes.